MultiFormatNavDataFactory.hpp
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 //==============================================================================
39 #ifndef GNSSTK_MULTIFORMATNAVDATAFACTORY_HPP
40 #define GNSSTK_MULTIFORMATNAVDATAFACTORY_HPP
41 
42 #include "gnsstk_export.h"
44 #include "NDFUniqIterator.hpp"
45 
46 namespace gnsstk
47 {
49 
50 
75  {
76  public:
79 
84 
99  bool find(const NavMessageID& nmid, const CommonTime& when,
100  NavDataPtr& navOut, SVHealth xmitHealth, NavValidityType valid,
101  NavSearchOrder order) override;
102 
104  bool getOffset(TimeSystem fromSys, TimeSystem toSys,
105  const CommonTime& when, NavDataPtr& offset,
106  SVHealth xmitHealth = SVHealth::Any,
108  override;
109 
115  void edit(const CommonTime& fromTime, const CommonTime& toTime) override;
116 
125  void edit(const CommonTime& fromTime, const CommonTime& toTime,
126  const NavSatelliteID& satID) override;
127 
136  void edit(const CommonTime& fromTime, const CommonTime& toTime,
137  const NavSignalID& signal) override;
138 
140  void clear() override;
141 
148  CommonTime getInitialTime() const override;
149 
156  CommonTime getFinalTime() const override;
157 
171  const CommonTime& toTime)
172  const override;
173 
188  const CommonTime& fromTime,
189  const CommonTime& toTime)
190  const override;
191 
205  const CommonTime& toTime)
206  const override;
207 
225  bool isPresent(const NavMessageID& nmid,
226  const CommonTime& fromTime,
227  const CommonTime& toTime) override;
228 
230  std::string getFactoryFormats() const override;
231 
233  size_t size() const override;
235  size_t count(const NavMessageID& nmid) const override;
237  size_t count(SatelliteSystem sys,
239  const override
240  { return NavDataFactoryWithStore::count(sys,nmt); }
242  size_t count(const SatID& satID,
244  const override
245  { return NavDataFactoryWithStore::count(satID,nmt); }
247  size_t count(NavMessageType nmt) const override
248  { return NavDataFactoryWithStore::count(nmt); }
250  size_t numSignals() const override;
252  size_t numSatellites() const override;
253 
259  void setValidityFilter(NavValidityType nvt) override;
260 
271  void setTypeFilter(const NavMessageTypeSet& nmts) override;
272 
277  void clearTypeFilter() override;
278 
284  void addTypeFilter(NavMessageType nmt) override;
285 
293  bool addDataSource(const std::string& source) override;
294 
296  bool process(const std::string& filename,
297  NavDataFactoryCallback& cb) override;
298 
305  static bool addFactory(NavDataFactoryPtr& fact);
306 
311  void dump(std::ostream& s, DumpDetail dl) const;
312 
317  template <class Fact>
318  std::shared_ptr<Fact> getFactory();
319 
324  void setControl(const FactoryControl& ctrl) override;
325 
326  protected:
330  static std::shared_ptr<NavDataFactoryMap> factories();
331 
335  std::shared_ptr<NavDataFactoryMap> myFactories;
336 
337  private:
342  bool loadIntoMap(const std::string& filename,
343  NavMessageMap& navMap,
344  NavNearMessageMap& navNearMap,
345  OffsetCvtMap& ofsMap) override
346  { return false; }
347  };
348 
349 
350  template <class Fact>
351  std::shared_ptr<Fact> MultiFormatNavDataFactory ::
353  {
354  std::shared_ptr<Fact> rv;
356  {
357  rv = std::dynamic_pointer_cast<Fact>(fi.second);
358  if (rv)
359  return rv;
360  }
361  return rv;
362  }
363 
365 
366 }
367 
368 #endif // GNSSTK_MULTIFORMATNAVDATAFACTORY_HPP
gnsstk::MultiFormatNavDataFactory::count
size_t count(NavMessageType nmt) const override
Definition: MultiFormatNavDataFactory.hpp:247
gnsstk::MultiFormatNavDataFactory::size
size_t size() const override
Return the number of nav messages in all factories.
Definition: MultiFormatNavDataFactory.cpp:278
gnsstk::NavDataPtr
std::shared_ptr< NavData > NavDataPtr
Factories instantiate these in response to find() requests.
Definition: NavData.hpp:62
gnsstk::NavMessageTypeSet
std::set< NavMessageType > NavMessageTypeSet
Set of message types, used by NavLibrary and NavDataFactory.
Definition: NavMessageType.hpp:76
gnsstk::MultiFormatNavDataFactory::numSatellites
size_t numSatellites() const override
Return the number of distinct signals including PRN, in factories.
Definition: MultiFormatNavDataFactory.cpp:342
gnsstk::NavMessageID
Class used to identify/categorize navigation message data.
Definition: NavMessageID.hpp:52
gnsstk::MultiFormatNavDataFactory::~MultiFormatNavDataFactory
virtual ~MultiFormatNavDataFactory()
Definition: MultiFormatNavDataFactory.cpp:59
gnsstk::MultiFormatNavDataFactory::myFactories
std::shared_ptr< NavDataFactoryMap > myFactories
Definition: MultiFormatNavDataFactory.hpp:335
gnsstk::MultiFormatNavDataFactory::getInitialTime
CommonTime getInitialTime() const override
Definition: MultiFormatNavDataFactory.cpp:152
gnsstk::MultiFormatNavDataFactory::find
bool find(const NavMessageID &nmid, const CommonTime &when, NavDataPtr &navOut, SVHealth xmitHealth, NavValidityType valid, NavSearchOrder order) override
Definition: MultiFormatNavDataFactory.cpp:66
gnsstk::MultiFormatNavDataFactory::loadIntoMap
bool loadIntoMap(const std::string &filename, NavMessageMap &navMap, NavNearMessageMap &navNearMap, OffsetCvtMap &ofsMap) override
Definition: MultiFormatNavDataFactory.hpp:342
gnsstk::NavDataFactoryWithStore::OffsetCvtMap
std::map< TimeCvtKey, OffsetEpochMap > OffsetCvtMap
Map from the time system conversion pair to the conversion objects.
Definition: NavDataFactoryWithStore.hpp:74
gnsstk::NavMessageMap
std::map< NavMessageType, NavSatMap > NavMessageMap
Map nav message type to the rest of the storage.
Definition: NavData.hpp:71
gnsstk::MultiFormatNavDataFactory::count
size_t count(const NavMessageID &nmid) const override
Definition: MultiFormatNavDataFactory.cpp:298
gnsstk::NavSatelliteID
Definition: NavSatelliteID.hpp:57
gnsstk::MultiFormatNavDataFactory::setTypeFilter
void setTypeFilter(const NavMessageTypeSet &nmts) override
Definition: MultiFormatNavDataFactory.cpp:380
gnsstk::SatelliteSystem
SatelliteSystem
Supported satellite systems.
Definition: SatelliteSystem.hpp:55
gnsstk::NavSatelliteIDSet
std::set< NavSatelliteID > NavSatelliteIDSet
Definition: NavSatelliteID.hpp:174
gnsstk::MultiFormatNavDataFactory::addFactory
static bool addFactory(NavDataFactoryPtr &fact)
Definition: MultiFormatNavDataFactory.cpp:417
gnsstk::SatID
Definition: SatID.hpp:89
gnsstk::MultiFormatNavDataFactory::numSignals
size_t numSignals() const override
Return the number of distinct signals (ignoring PRN) in factories.
Definition: MultiFormatNavDataFactory.cpp:318
gnsstk::MultiFormatNavDataFactory::getOffset
bool getOffset(TimeSystem fromSys, TimeSystem toSys, const CommonTime &when, NavDataPtr &offset, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly) override
Definition: MultiFormatNavDataFactory.cpp:93
gnsstk::SVHealth
SVHealth
Identify different types of SV health states.
Definition: SVHealth.hpp:52
gnsstk::NavValidityType
NavValidityType
Definition: NavValidityType.hpp:53
gnsstk::NavSearchOrder
NavSearchOrder
Specify the behavior of nav data searches in NavLibrary/NavDataFactory.
Definition: NavSearchOrder.hpp:51
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::MultiFormatNavDataFactory::getFactoryFormats
std::string getFactoryFormats() const override
Return a comma-separated list of formats supported by the factories.
Definition: MultiFormatNavDataFactory.cpp:506
gnsstk::MultiFormatNavDataFactory::getFactory
std::shared_ptr< Fact > getFactory()
Definition: MultiFormatNavDataFactory.hpp:352
gnsstk::NavDataFactoryWithStore::count
virtual size_t count(const NavMessageID &nmid) const
Definition: NavDataFactoryWithStore.cpp:1022
gnsstk::NavDataFactoryWithStoreFile
Define an interface for loading nav data from a file.
Definition: NavDataFactoryWithStoreFile.hpp:51
gnsstk::NavDataFactoryPtr
std::shared_ptr< NavDataFactory > NavDataFactoryPtr
Managed pointer to NavDataFactory.
Definition: NavDataFactory.hpp:398
gnsstk::NavDataFactoryCallback
Definition: NavDataFactoryCallback.hpp:54
gnsstk::MultiFormatNavDataFactory::clear
void clear() override
Remove all data from the internal store.
Definition: MultiFormatNavDataFactory.cpp:142
gnsstk::SVHealth::Any
@ Any
Use in searches when you don't care about the SV health.
gnsstk::MultiFormatNavDataFactory::getAvailableSats
NavSatelliteIDSet getAvailableSats(const CommonTime &fromTime, const CommonTime &toTime) const override
Definition: MultiFormatNavDataFactory.cpp:210
NDFUniqIterator.hpp
gnsstk::MultiFormatNavDataFactory::dump
void dump(std::ostream &s, DumpDetail dl) const
Definition: MultiFormatNavDataFactory.cpp:484
gnsstk::NavMessageType::Unknown
@ Unknown
Message type is not known or is uninitialized.
gnsstk::MultiFormatNavDataFactory::edit
void edit(const CommonTime &fromTime, const CommonTime &toTime) override
Definition: MultiFormatNavDataFactory.cpp:110
gnsstk::NavValidityType::ValidOnly
@ ValidOnly
Only load/find nav messages that pass validity checks.
gnsstk::MultiFormatNavDataFactory::setControl
void setControl(const FactoryControl &ctrl) override
Definition: MultiFormatNavDataFactory.cpp:495
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::MultiFormatNavDataFactory
Definition: MultiFormatNavDataFactory.hpp:74
gnsstk::FactoryControl
Definition: FactoryControl.hpp:52
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
example6.valid
valid
Definition: example6.py:20
gnsstk::MultiFormatNavDataFactory::getAvailableMsgs
NavMessageIDSet getAvailableMsgs(const CommonTime &fromTime, const CommonTime &toTime) const override
Definition: MultiFormatNavDataFactory.cpp:246
NavDataFactoryWithStoreFile.hpp
gnsstk::MultiFormatNavDataFactory::factories
static std::shared_ptr< NavDataFactoryMap > factories()
Definition: MultiFormatNavDataFactory.cpp:525
gnsstk::MultiFormatNavDataFactory::MultiFormatNavDataFactory
MultiFormatNavDataFactory()
Initialize supportedSignals from factories.
Definition: MultiFormatNavDataFactory.cpp:46
gnsstk::MultiFormatNavDataFactory::count
size_t count(const SatID &satID, NavMessageType nmt=NavMessageType::Unknown) const override
Definition: MultiFormatNavDataFactory.hpp:242
gnsstk::NavSignalID
Class used to identify navigation data signal types.
Definition: NavSignalID.hpp:54
gnsstk::MultiFormatNavDataFactory::clearTypeFilter
void clearTypeFilter() override
Definition: MultiFormatNavDataFactory.cpp:395
gnsstk::DumpDetail
DumpDetail
Specify level of detail for dump output.
Definition: DumpDetail.hpp:51
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::MultiFormatNavDataFactory::process
bool process(const std::string &filename, NavDataFactoryCallback &cb) override
Definition: MultiFormatNavDataFactory.cpp:462
gnsstk::MultiFormatNavDataFactory::isPresent
bool isPresent(const NavMessageID &nmid, const CommonTime &fromTime, const CommonTime &toTime) override
Definition: MultiFormatNavDataFactory.cpp:264
gnsstk::NDFUniqIterator
Definition: NDFUniqIterator.hpp:60
gnsstk::MultiFormatNavDataFactory::setValidityFilter
void setValidityFilter(NavValidityType nvt) override
Definition: MultiFormatNavDataFactory.cpp:366
gnsstk::MultiFormatNavDataFactory::count
size_t count(SatelliteSystem sys, NavMessageType nmt=NavMessageType::Unknown) const override
Definition: MultiFormatNavDataFactory.hpp:237
gnsstk::NavNearMessageMap
std::map< NavMessageType, NavNearSatMap > NavNearMessageMap
Map nav message type to the rest of the storage.
Definition: NavData.hpp:81
gnsstk::NavMessageIDSet
std::set< NavMessageID > NavMessageIDSet
Definition: NavMessageID.hpp:101
gnsstk::MultiFormatNavDataFactory::getFinalTime
CommonTime getFinalTime() const override
Definition: MultiFormatNavDataFactory.cpp:181
gnsstk::MultiFormatNavDataFactory::addDataSource
bool addDataSource(const std::string &source) override
Definition: MultiFormatNavDataFactory.cpp:441
gnsstk::MultiFormatNavDataFactory::addTypeFilter
void addTypeFilter(NavMessageType nmt) override
Definition: MultiFormatNavDataFactory.cpp:406


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