navfilterex-pseudo-inherit.cpp

Pseudo-code example of using inheritance for the filter data for storing the navigation messages processed by the filter.

//==============================================================================
//
// This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
//
// The GNSSTk is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 3.0 of the License, or
// any later version.
//
// The GNSSTk is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with GNSSTk; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
//
// This software was developed by Applied Research Laboratories at the
// University of Texas at Austin.
// Copyright 2004-2022, The Board of Regents of The University of Texas System
//
//==============================================================================
//==============================================================================
//
// This software was developed by Applied Research Laboratories at the
// University of Texas at Austin, under contract to an agency or agencies
// within the U.S. Department of Defense. The U.S. Government retains all
// rights to use, duplicate, distribute, disclose, or release this software.
//
// Pursuant to DoD Directive 523024
//
// DISTRIBUTION STATEMENT A: This software has been approved for public
// release, distribution is unlimited.
//
//==============================================================================
{
public:
std::vector<uint32_t> subframe;
};
{
public:
};
{
if (!strm)
return NULL;
strm >> rv->appData;
retun rv;
}
void filterEX()
{
// Filter manager, where the work is done
// Individual filters being applied
gnsstk::NavFilter::NavMsgList::const_iterator nmli;
// Tell the manager what filters to use
mgr.addFilter(&filtCook);
mgr.addFilter(&filtVote);
while (strm)
{
// validate the subframe
// process the results
for (nmli = l.begin(); nmli != l.end(); nmli++)
{
MyNavFilterData *ofd = dynamic_cast<MyNavFilterData*>(*nmli);
// do something with fd (nav message that passed the filters)
// Then free the memory. Note that this would also free
// the application's data, so you may want to delay this
// depending on what you're trying to do.
delete ofd;
}
}
// Finalize the filters. Probably not necessary when using only
// depth 1 filters, but good practice in any case.
// process the results
for (nmli = l.begin(); nmli != l.end(); nmli++)
{
MyNavFilterData *ofd = dynamic_cast<MyNavFilterData*>(*nmli);
// do something with fd (nav message that passed the filters)
// Then free the memory. Note that this would also free
// the application's data, so you may want to delay this
// depending on what you're trying to do.
delete ofd;
}
}
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:38