PNBMultiGNSSNavDataFactory.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 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
40 #include "DebugTrace.hpp"
41 
42 namespace gnsstk
43 {
46  {
47  // get our own shared pointer to the factories map.
49  }
50 
51 
54  {
55  for (auto& fi : *myFactories)
56  {
57  fi.second->setValidityFilter(nvt);
58  }
59  }
60 
61 
64  {
65  for (auto& fi : *myFactories)
66  {
67  fi.second->setTypeFilter(nmts);
68  }
69  }
70 
71 
74  double cadence)
75  {
77  NavType navType = navIn->getNavID().navType;
78  auto fi = myFactories->find(navType);
79  if (fi == myFactories->end())
80  {
81  DEBUGTRACE("No factory for " + StringUtils::asString(navType));
82  DEBUGTRACE(*(navIn.get()));
83  // We don't have a factory for this navigation message type
84  return false;
85  }
86  return fi->second->addData(navIn, navOut, cadence);
87  }
88 
89 
92  {
93  // make sure it's a valid class first
94  PNBNavDataFactory *ndfp = fact.get();
95  if (ndfp == nullptr)
96  {
97  return false;
98  }
99  if (dynamic_cast<PNBMultiGNSSNavDataFactory*>(ndfp) != nullptr)
100  {
101  return false;
102  }
103  (*factories())[navType] = fact;
104  return true;
105  }
106 
107 
110  {
111  for (auto& fi : *myFactories)
112  {
113  fi.second->resetState();
114  }
115  }
116 
117 
118  std::shared_ptr<PNBNavDataFactoryMap> PNBMultiGNSSNavDataFactory ::
120  {
121  static std::shared_ptr<PNBNavDataFactoryMap> rv =
122  std::make_shared<PNBNavDataFactoryMap>();
123  return rv;
124  }
125 
126 
129  {
130  for (auto& fi : *myFactories)
131  {
132  fi.second->setControl(ctrl);
133  }
134  }
135 }
gnsstk::NavMessageTypeSet
std::set< NavMessageType > NavMessageTypeSet
Set of message types, used by NavLibrary and NavDataFactory.
Definition: NavMessageType.hpp:76
gnsstk::PackedNavBitsPtr
std::shared_ptr< PackedNavBits > PackedNavBitsPtr
Managed pointer for passing PackedNavBits around.
Definition: PackedNavBits.hpp:66
gnsstk::PNBNavDataFactoryPtr
std::shared_ptr< PNBNavDataFactory > PNBNavDataFactoryPtr
Managed pointer to a PNBNavDataFactory.
Definition: PNBNavDataFactory.hpp:138
gnsstk::PNBMultiGNSSNavDataFactory::addFactory
static bool addFactory(NavType navType, PNBNavDataFactoryPtr &fact)
Definition: PNBMultiGNSSNavDataFactory.cpp:91
gnsstk::PNBMultiGNSSNavDataFactory::resetState
void resetState() override
Definition: PNBMultiGNSSNavDataFactory.cpp:109
gnsstk::PNBMultiGNSSNavDataFactory::myFactories
std::shared_ptr< PNBNavDataFactoryMap > myFactories
Definition: PNBMultiGNSSNavDataFactory.hpp:136
DEBUGTRACE
#define DEBUGTRACE(EXPR)
Definition: DebugTrace.hpp:119
gnsstk::NavDataPtrList
std::list< NavDataPtr > NavDataPtrList
Definition: NavData.hpp:75
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::NavValidityType
NavValidityType
Definition: NavValidityType.hpp:53
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::PNBMultiGNSSNavDataFactory::addData
bool addData(const PackedNavBitsPtr &navIn, NavDataPtrList &navOut, double cadence=-1) override
Definition: PNBMultiGNSSNavDataFactory.cpp:73
gnsstk::FactoryControl
Definition: FactoryControl.hpp:52
gnsstk::PNBMultiGNSSNavDataFactory::PNBMultiGNSSNavDataFactory
PNBMultiGNSSNavDataFactory()
Initialize myFactories.
Definition: PNBMultiGNSSNavDataFactory.cpp:45
gnsstk::PNBMultiGNSSNavDataFactory::factories
static std::shared_ptr< PNBNavDataFactoryMap > factories()
Definition: PNBMultiGNSSNavDataFactory.cpp:119
DebugTrace.hpp
gnsstk::PNBMultiGNSSNavDataFactory
Definition: PNBMultiGNSSNavDataFactory.hpp:66
DEBUGTRACE_FUNCTION
#define DEBUGTRACE_FUNCTION()
Definition: DebugTrace.hpp:117
PNBMultiGNSSNavDataFactory.hpp
gnsstk::PNBMultiGNSSNavDataFactory::setControl
void setControl(const FactoryControl &ctrl) override
Definition: PNBMultiGNSSNavDataFactory.cpp:128
gnsstk::NavType
NavType
Supported navigation types.
Definition: NavType.hpp:58
gnsstk::PNBMultiGNSSNavDataFactory::setTypeFilter
void setTypeFilter(const NavMessageTypeSet &nmts) override
Definition: PNBMultiGNSSNavDataFactory.cpp:63
gnsstk::PNBMultiGNSSNavDataFactory::setValidityFilter
void setValidityFilter(NavValidityType nvt) override
Definition: PNBMultiGNSSNavDataFactory.cpp:53
gnsstk::PNBNavDataFactory
Definition: PNBNavDataFactory.hpp:61


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