navfilterex-pseudo-inherit.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
43 class NavSubframe
45 {
46 public:
49  std::vector<uint32_t> subframe;
50 };
51 
54 {
55 public:
57 };
58 
61 {
62  if (!strm)
63  return NULL;
64  MyNavFilterData *rv = new MyNavFilterData();
65  strm >> rv->appData;
66  retun rv;
67 }
68 
69 void filterEX()
70 {
71  // Filter manager, where the work is done
73  // Individual filters being applied
74  gnsstk::LNavCookFilter filtCook;
76  gnsstk::NavFilter::NavMsgList::const_iterator nmli;
77 
78  // Tell the manager what filters to use
79  mgr.addFilter(&filtCook);
80  mgr.addFilter(&filtVote);
81 
82  while (strm)
83  {
84  MyNavFilterData *fd = readNav();
85 
86  // validate the subframe
88 
89  // process the results
90  for (nmli = l.begin(); nmli != l.end(); nmli++)
91  {
92  MyNavFilterData *ofd = dynamic_cast<MyNavFilterData*>(*nmli);
93  // do something with fd (nav message that passed the filters)
94 
95  // Then free the memory. Note that this would also free
96  // the application's data, so you may want to delay this
97  // depending on what you're trying to do.
98  delete ofd;
99  }
100  }
101 
102  // Finalize the filters. Probably not necessary when using only
103  // depth 1 filters, but good practice in any case.
105 
106  // process the results
107  for (nmli = l.begin(); nmli != l.end(); nmli++)
108  {
109  MyNavFilterData *ofd = dynamic_cast<MyNavFilterData*>(*nmli);
110  // do something with fd (nav message that passed the filters)
111 
112  // Then free the memory. Note that this would also free
113  // the application's data, so you may want to delay this
114  // depending on what you're trying to do.
115  delete ofd;
116  }
117 }
filterEX
void filterEX()
Definition: navfilterex-pseudo-inherit.cpp:69
NavSubframe::subframe
std::vector< uint32_t > subframe
Definition: navfilterex-pseudo-container.cpp:49
MyNavFilterData::appData
NavSubframe appData
Definition: navfilterex-pseudo-inherit.cpp:56
gnsstk::LNavCrossSourceFilter
Definition: LNavCrossSourceFilter.hpp:57
MyNavFilterData
Combine the nav filter store and the application store into a single class.
Definition: navfilterex-pseudo-inherit.cpp:53
gnsstk::LNavCookFilter
Definition: LNavCookFilter.hpp:54
gnsstk::NavFilterMgr::finalize
virtual NavFilter::NavMsgList finalize()
Definition: NavFilterMgr.cpp:78
NULL
#define NULL
Definition: getopt1.c:64
gnsstk::NavFilterMgr
Definition: NavFilterMgr.hpp:170
gnsstk::NavFilterMgr::addFilter
void addFilter(NavFilter *filt)
Definition: NavFilterMgr.cpp:50
NavSubframe
application's navigation message storage class
Definition: navfilterex-pseudo-container.cpp:44
gnsstk::NavFilterMgr::validate
NavFilter::NavMsgList validate(NavFilterKey *msgBits)
Definition: NavFilterMgr.cpp:57
gnsstk::LNavFilterData
Definition: LNavFilterData.hpp:52
gnsstk::NavFilter::NavMsgList
std::list< NavFilterKey * > NavMsgList
Definition: NavFilter.hpp:58
readNav
MyNavFilterData * readNav()
function to read a single nav subframe
Definition: navfilterex-pseudo-inherit.cpp:60


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40