NavDataFactoryWithStore.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_NAVDATAFACTORYWITHSTORE_HPP
40 #define GNSSTK_NAVDATAFACTORYWITHSTORE_HPP
41 
42 #include "NavDataFactory.hpp"
43 #include "TimeOffsetData.hpp"
44 #include "StdNavTimeOffset.hpp"
45 
46 namespace gnsstk
47 {
49 
50 
64  {
65  public:
66  // Time offset information is organized differently due to the use case
69  typedef std::map<NavSatelliteID, NavDataPtr> OffsetMap;
72  typedef std::map<CommonTime, OffsetMap> OffsetEpochMap;
74  typedef std::map<TimeCvtKey, OffsetEpochMap> OffsetCvtMap;
75 
78 
81  {
82  }
83 
103  bool find(const NavMessageID& nmid, const CommonTime& when,
104  NavDataPtr& navOut, SVHealth xmitHealth, NavValidityType valid,
105  NavSearchOrder order) override;
106 
108  bool getOffset(TimeSystem fromSys, TimeSystem toSys,
109  const CommonTime& when, NavDataPtr& offset,
110  SVHealth xmitHealth = SVHealth::Any,
112  override;
113 
119  void edit(const CommonTime& fromTime, const CommonTime& toTime) override;
120 
129  void edit(const CommonTime& fromTime, const CommonTime& toTime,
130  const NavSatelliteID& satID) override;
131 
140  void edit(const CommonTime& fromTime, const CommonTime& toTime,
141  const NavSignalID& signal) override;
142 
144  void clear() override;
145 
149  bool addNavData(const NavDataPtr& nd)
150  { return addNavData(nd, data, nearestData, offsetData); }
151 
159  bool addNavData(const NavDataPtr& nd, NavMessageMap& navMap,
160  NavNearMessageMap& navNearMap, OffsetCvtMap& ofsMap);
161 
166  CommonTime getInitialTime() const override
167  { return initialTime; }
168 
173  CommonTime getFinalTime() const override
174  { return finalTime; }
175 
181  CommonTime getFirstTime(const SatID& sat) const;
182 
188  CommonTime getLastTime(const SatID& sat) const;
189 
203  const CommonTime& toTime)
204  const override;
205 
220  const CommonTime& fromTime,
221  const CommonTime& toTime)
222  const override;
223 
237  std::set<SatID> getIndexSet(const CommonTime& fromTime,
238  const CommonTime& toTime) const;
239 
254  std::set<SatID> getIndexSet(NavMessageType nmt,
255  const CommonTime& fromTime,
256  const CommonTime& toTime) const;
257 
271  const CommonTime& toTime) const override;
272 
274  virtual size_t size() const;
307  virtual size_t count(const NavMessageID& nmid) const;
317  virtual size_t count(SatelliteSystem sys,
319  const;
326  virtual size_t count(const SatID& satID,
328  const;
332  virtual size_t count(NavMessageType nmt) const;
334  virtual size_t numSignals() const;
336  virtual size_t numSatellites() const;
341  void dump(std::ostream& s, DumpDetail dl) const override;
344  { return data; }
347  { return nearestData; }
350  { return offsetData; }
354  const NavMap* getNavMap(const NavMessageID& nmid) const;
355 
356  protected:
374  virtual bool findUser(const NavMessageID& nmid, const CommonTime& when,
375  NavDataPtr& navData, SVHealth xmitHealth,
377 
396  virtual bool findNearest(const NavMessageID& nmid, const CommonTime& when,
397  NavDataPtr& navData, SVHealth xmitHealth,
399 
412  bool validityCheck(const NavMap::iterator& ti,
413  NavMap& nm,
415  SVHealth xmitHealth,
416  const CommonTime& when);
417 
428  bool validityCheck(const NavDataPtr& ndp,
430  SVHealth xmitHealth,
431  const CommonTime& when);
432 
440  bool matchHealth(NavData *ndp, SVHealth xmitHealth);
441 
453  bool updateInitialFinal(const CommonTime& begin, const CommonTime& end);
454 
467  std::map<SatID,std::pair<CommonTime,CommonTime> > firstLastMap;
468 
473 
474  private:
479  {
480  public:
481  bool operator()(const std::shared_ptr<StdNavTimeOffset>& left,
482  const std::shared_ptr<StdNavTimeOffset>& right) const;
483  };
484 
486  using TOUSet = std::set<std::shared_ptr<StdNavTimeOffset>,
489  using TOUSatMap = std::map<SatID, TOUSet>;
491  using TOUSigMap = std::map<NavSignalID, TOUSet>;
492 
495  };
496 
498 
499 }
500 
501 #endif // GNSSTK_NAVDATAFACTORYWITHSTORE_HPP
gnsstk::NavDataPtr
std::shared_ptr< NavData > NavDataPtr
Factories instantiate these in response to find() requests.
Definition: NavData.hpp:62
gnsstk::NavDataFactoryWithStore::addNavData
bool addNavData(const NavDataPtr &nd)
Definition: NavDataFactoryWithStore.hpp:149
gnsstk::NavDataFactoryWithStore::findNearest
virtual bool findNearest(const NavMessageID &nmid, const CommonTime &when, NavDataPtr &navData, SVHealth xmitHealth, NavValidityType valid)
Definition: NavDataFactoryWithStore.cpp:291
gnsstk::NavMessageID
Class used to identify/categorize navigation message data.
Definition: NavMessageID.hpp:52
gnsstk::NavDataFactoryWithStore::OffsetMap
std::map< NavSatelliteID, NavDataPtr > OffsetMap
Definition: NavDataFactoryWithStore.hpp:69
gnsstk::NavDataFactoryWithStore::dump
void dump(std::ostream &s, DumpDetail dl) const override
Definition: NavDataFactoryWithStore.cpp:1458
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::NavDataFactoryWithStore::OffsetEpochMap
std::map< CommonTime, OffsetMap > OffsetEpochMap
Definition: NavDataFactoryWithStore.hpp:72
gnsstk::NavDataFactoryWithStore::numSignals
virtual size_t numSignals() const
Return the number of distinct signals (ignoring PRN) in the data.
Definition: NavDataFactoryWithStore.cpp:1130
gnsstk::NavDataFactoryWithStore::findUser
virtual bool findUser(const NavMessageID &nmid, const CommonTime &when, NavDataPtr &navData, SVHealth xmitHealth, NavValidityType valid)
Definition: NavDataFactoryWithStore.cpp:105
gnsstk::NavSatelliteID
Definition: NavSatelliteID.hpp:57
gnsstk::NavDataFactoryWithStore::touBySV
TOUSatMap touBySV
Each satellite's uniquely transmitted time offset.
Definition: NavDataFactoryWithStore.hpp:493
gnsstk::SatelliteSystem
SatelliteSystem
Supported satellite systems.
Definition: SatelliteSystem.hpp:55
gnsstk::NavSatelliteIDSet
std::set< NavSatelliteID > NavSatelliteIDSet
Definition: NavSatelliteID.hpp:174
gnsstk::NavData
Definition: NavData.hpp:86
gnsstk::NavDataFactoryWithStore::getNavMessageMap
const NavMessageMap & getNavMessageMap() const
Get read-only access to the nav data map (User priority).
Definition: NavDataFactoryWithStore.hpp:343
gnsstk::SatID
Definition: SatID.hpp:89
StdNavTimeOffset.hpp
gnsstk::NavDataFactoryWithStore::updateInitialFinal
bool updateInitialFinal(const CommonTime &begin, const CommonTime &end)
Definition: NavDataFactoryWithStore.cpp:957
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::NavDataFactoryWithStore::getAvailableMsgs
NavMessageIDSet getAvailableMsgs(const CommonTime &fromTime, const CommonTime &toTime) const override
Definition: NavDataFactoryWithStore.cpp:1421
gnsstk::NavDataFactoryWithStore::count
virtual size_t count(const NavMessageID &nmid) const
Definition: NavDataFactoryWithStore.cpp:1022
gnsstk::NavDataFactoryWithStore::TOUSet
std::set< std::shared_ptr< StdNavTimeOffset >, UniqueTimeOffset > TOUSet
Collect unique StdNavTimeOffset data.
Definition: NavDataFactoryWithStore.hpp:487
gnsstk::NavDataFactoryWithStore::NavDataFactoryWithStore
NavDataFactoryWithStore()
Initialize internal data.
Definition: NavDataFactoryWithStore.cpp:55
gnsstk::SVHealth::Any
@ Any
Use in searches when you don't care about the SV health.
gnsstk::NavDataFactoryWithStore::initialTime
CommonTime initialTime
Store the earliest applicable orbit time here, by addNavData.
Definition: NavDataFactoryWithStore.hpp:463
gnsstk::NavDataFactoryWithStore::getFirstTime
CommonTime getFirstTime(const SatID &sat) const
Definition: NavDataFactoryWithStore.cpp:1326
gnsstk::NavDataFactoryStoreCallback
Definition: NavDataFactoryStoreCallback.hpp:52
gnsstk::NavDataFactoryWithStore::firstLastMap
std::map< SatID, std::pair< CommonTime, CommonTime > > firstLastMap
Map subject satellite ID to time stamp pair (oldest,newest).
Definition: NavDataFactoryWithStore.hpp:467
gnsstk::NavMessageType::Unknown
@ Unknown
Message type is not known or is uninitialized.
gnsstk::NavDataFactoryWithStore::size
virtual size_t size() const
Return the number of nav messages in data.
Definition: NavDataFactoryWithStore.cpp:1005
gnsstk::NavDataFactoryWithStore::getLastTime
CommonTime getLastTime(const SatID &sat) const
Definition: NavDataFactoryWithStore.cpp:1335
gnsstk::NavValidityType::ValidOnly
@ ValidOnly
Only load/find nav messages that pass validity checks.
gnsstk::NavDataFactoryWithStore::getAvailableSats
NavSatelliteIDSet getAvailableSats(const CommonTime &fromTime, const CommonTime &toTime) const override
Definition: NavDataFactoryWithStore.cpp:1344
gnsstk::NavDataFactoryWithStore::edit
void edit(const CommonTime &fromTime, const CommonTime &toTime) override
Definition: NavDataFactoryWithStore.cpp:556
nd
int nd
Definition: IERS1996NutationData.hpp:44
gnsstk::NavDataFactoryWithStore::TOUSatMap
std::map< SatID, TOUSet > TOUSatMap
Map transmitting satellite to unique time offsets.
Definition: NavDataFactoryWithStore.hpp:489
gnsstk::MultiFormatNavDataFactory
Definition: MultiFormatNavDataFactory.hpp:74
gnsstk::CommonTime
Definition: CommonTime.hpp:84
TimeOffsetData.hpp
gnsstk::NavDataFactoryWithStore::getTimeOffsetMap
const OffsetCvtMap & getTimeOffsetMap() const
Get read-only access to the time offset map.
Definition: NavDataFactoryWithStore.hpp:349
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition: TimeSystem.hpp:51
example6.valid
valid
Definition: example6.py:20
gnsstk::NavDataFactoryWithStore::numSatellites
virtual size_t numSatellites() const
Return the number of distinct signals including PRN, in the data.
Definition: NavDataFactoryWithStore.cpp:1145
gnsstk::NavDataFactoryWithStore::touBySig
TOUSigMap touBySig
Each signal's uniquely transmitted time offset.
Definition: NavDataFactoryWithStore.hpp:494
gnsstk::NavDataFactoryWithStore::getNavNearMessageMap
const NavNearMessageMap & getNavNearMessageMap() const
Get read-only access to the nav data map (Nearest priority).
Definition: NavDataFactoryWithStore.hpp:346
gnsstk::NavDataFactoryWithStore::find
bool find(const NavMessageID &nmid, const CommonTime &when, NavDataPtr &navOut, SVHealth xmitHealth, NavValidityType valid, NavSearchOrder order) override
Definition: NavDataFactoryWithStore.cpp:68
gnsstk::NavDataFactoryWithStore::data
NavMessageMap data
Internal storage of navigation data for User searches.
Definition: NavDataFactoryWithStore.hpp:456
gnsstk::NavSignalID
Class used to identify navigation data signal types.
Definition: NavSignalID.hpp:54
gnsstk::DumpDetail
DumpDetail
Specify level of detail for dump output.
Definition: DumpDetail.hpp:51
gnsstk::NavDataFactoryWithStore::getIndexSet
std::set< SatID > getIndexSet(const CommonTime &fromTime, const CommonTime &toTime) const
Definition: NavDataFactoryWithStore.cpp:1380
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
example4.navData
navData
Definition: example4.py:15
gnsstk::NavDataFactoryWithStore::UniqueTimeOffset::operator()
bool operator()(const std::shared_ptr< StdNavTimeOffset > &left, const std::shared_ptr< StdNavTimeOffset > &right) const
Definition: NavDataFactoryWithStore.cpp:1513
gnsstk::NavDataFactoryWithStore::UniqueTimeOffset
Definition: NavDataFactoryWithStore.hpp:478
gnsstk::NavDataFactoryWithStore::getFinalTime
CommonTime getFinalTime() const override
Definition: NavDataFactoryWithStore.hpp:173
gnsstk::NavDataFactoryWithStore::~NavDataFactoryWithStore
virtual ~NavDataFactoryWithStore()
Clean up.
Definition: NavDataFactoryWithStore.hpp:80
gnsstk::NavDataFactoryWithStore::matchHealth
bool matchHealth(NavData *ndp, SVHealth xmitHealth)
Definition: NavDataFactoryWithStore.cpp:1224
gnsstk::NavDataFactory
Definition: NavDataFactory.hpp:60
gnsstk::NavDataFactoryWithStore::clear
void clear() override
Remove all data from the internal store.
Definition: NavDataFactoryWithStore.cpp:840
gnsstk::NavMap
std::map< CommonTime, NavDataPtr > NavMap
Map nav message transmit time to nav message.
Definition: NavData.hpp:67
gnsstk::NavDataFactoryWithStore::nearestData
NavNearMessageMap nearestData
Internal storage of navigation data for Nearest searches.
Definition: NavDataFactoryWithStore.hpp:458
gnsstk::NavDataFactoryWithStore::offsetData
OffsetCvtMap offsetData
Definition: NavDataFactoryWithStore.hpp:461
gnsstk::NavNearMessageMap
std::map< NavMessageType, NavNearSatMap > NavNearMessageMap
Map nav message type to the rest of the storage.
Definition: NavData.hpp:81
gnsstk::NavDataFactoryWithStore::getInitialTime
CommonTime getInitialTime() const override
Definition: NavDataFactoryWithStore.hpp:166
gnsstk::NavMessageIDSet
std::set< NavMessageID > NavMessageIDSet
Definition: NavMessageID.hpp:101
NavDataFactory.hpp
gnsstk::NavDataFactoryWithStore::getNavMap
const NavMap * getNavMap(const NavMessageID &nmid) const
Definition: NavDataFactoryWithStore.cpp:1442
gnsstk::NavDataFactoryWithStore::validityCheck
bool validityCheck(const NavMap::iterator &ti, NavMap &nm, NavValidityType valid, SVHealth xmitHealth, const CommonTime &when)
Definition: NavDataFactoryWithStore.cpp:1160
gnsstk::NavDataFactoryWithStore::TOUSigMap
std::map< NavSignalID, TOUSet > TOUSigMap
Map signal to unique time offsets.
Definition: NavDataFactoryWithStore.hpp:491
gnsstk::NavDataFactoryWithStore::finalTime
CommonTime finalTime
Store the latest applicable orbit time here, by addNavData.
Definition: NavDataFactoryWithStore.hpp:465
gnsstk::NavDataFactoryWithStore::getOffset
bool getOffset(TimeSystem fromSys, TimeSystem toSys, const CommonTime &when, NavDataPtr &offset, SVHealth xmitHealth=SVHealth::Any, NavValidityType valid=NavValidityType::ValidOnly) override
Definition: NavDataFactoryWithStore.cpp:439
gnsstk::NavDataFactoryWithStore
Definition: NavDataFactoryWithStore.hpp:63


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