Define a class that allows you to use a single factory object that can read data from a variety of formats. The supported formats depend on what libraries you link against, as the libraries themselves add factories to the supported list at run-time. This class shares a lot of similarities with NavLibrary, but NavLibrary implements high-level routines such as getXvt(), while this class is set up to automatically include support for available factory types.
Definition at line 74 of file MultiFormatNavDataFactory.hpp.
#include <MultiFormatNavDataFactory.hpp>
Static Public Member Functions | |
static bool | addFactory (NavDataFactoryPtr &fact) |
Static Protected Member Functions | |
static std::shared_ptr< NavDataFactoryMap > | factories () |
Protected Attributes | |
std::shared_ptr< NavDataFactoryMap > | myFactories |
![]() | |
NavMessageMap | data |
Internal storage of navigation data for User searches. More... | |
CommonTime | finalTime |
Store the latest applicable orbit time here, by addNavData. More... | |
std::map< SatID, std::pair< CommonTime, CommonTime > > | firstLastMap |
Map subject satellite ID to time stamp pair (oldest,newest). More... | |
CommonTime | initialTime |
Store the earliest applicable orbit time here, by addNavData. More... | |
NavNearMessageMap | nearestData |
Internal storage of navigation data for Nearest searches. More... | |
OffsetCvtMap | offsetData |
![]() | |
FactoryControl | factControl |
Configuration for the behavior of this factory. More... | |
NavValidityType | navValidity |
NavMessageTypeSet | procNavTypes |
Private Member Functions | |
bool | loadIntoMap (const std::string &filename, NavMessageMap &navMap, NavNearMessageMap &navNearMap, OffsetCvtMap &ofsMap) override |
gnsstk::MultiFormatNavDataFactory::MultiFormatNavDataFactory | ( | ) |
Initialize supportedSignals from factories.
Definition at line 46 of file MultiFormatNavDataFactory.cpp.
|
virtual |
Clear all associated factories so as to avoid surprises if you ever instantiate more than one MultiFormatNavDataFactory in a session.
Definition at line 59 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Method for loading data. This will iterate over the available factories, calling their load method until one succeeds, since failure typically indicates an invalid input.
[in] | source | The path of the file to load. |
Implements gnsstk::NavDataFactory.
Definition at line 441 of file MultiFormatNavDataFactory.cpp.
|
static |
Add a new factory to the library. The factory must be derived from NavDataFactoryWithStoreFile but not a MultiFormatNavDataFactory.
[in] | fact | The NavDataFactory object to add to the library. |
Definition at line 417 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Add a NavMessageType to be processed to each of the factories. This should be used prior to loading data and as an alternate approach to setTypeFilter().
[in] | nmt | The NavMessageType to be processed on the next load. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 406 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Remove all data from the internal store.
Reimplemented from gnsstk::NavDataFactory.
Definition at line 142 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Clear the type filters of each of the factories. This should be used prior to loading data, and prior to using addTypeFilter(), if that API is going to be used instead of setTypeFilter().
Reimplemented from gnsstk::NavDataFactory.
Definition at line 395 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Return a count of messages matching the given NavMessageID.
[in] | nmid | The NavMessageID to match. Wildcards may be used. In addition to the standard wildcard support in SatID, ObsID and NavID, the signal field may be set to "Unknown" to be treated as a wildcard, as may the messageType field. The following code snippet represents a NavMessageID with all wildcards (which will match the results from the size() method). |
The system field is initialized in the above constructor from the SatID system, which is why we're initializing it to "Unknown" (to make system a wildcard). But setting the SatID::system to Unknown doesn't make SatID a wildcard, that requires the SatID::makeWild() method calls.
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 298 of file MultiFormatNavDataFactory.cpp.
|
inlineoverridevirtual |
Return a count of messages where the SUBJECT satellite ID matches the given SatID and message type.
[in] | satID | The subject satellite ID to match. |
[in] | nmt | The NavMessageType to match (default Unknown=all). |
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 242 of file MultiFormatNavDataFactory.hpp.
|
inlineoverridevirtual |
Return a count of messages matching the given NavMessageType.
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 247 of file MultiFormatNavDataFactory.hpp.
|
inlineoverridevirtual |
Return a count of messages matching the given SatelliteSystem and NavMessageType.
[in] | sys | The SatelliteSystem to match when counting. |
[in] | nmt | The NavMessageType to match (default Unknown=all). |
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 237 of file MultiFormatNavDataFactory.hpp.
|
virtual |
Print the contents of all factories in a human-readable format.
[in,out] | s | The stream to write the data to. |
[in] | dl | The level of detail the output should contain. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 484 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Remove all data from the internal storage in the time span [fromTime,toTime).
[in] | fromTime | The earliest time to be removed. |
[in] | toTime | The earliest time that will NOT be removed. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 110 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Remove data for a specific satellite signal from the internal storage in the time span [fromTime,toTime).
[in] | fromTime | The earliest time to be removed. |
[in] | toTime | The earliest time that will NOT be removed. |
[in] | satID | The complete signal specification for the data to be removed (subject satellite, transmit satellite, system, carrier, code, nav). |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 120 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Remove data for all satellites matching a specific signal from the internal storage in the time span [fromTime,toTime).
[in] | fromTime | The earliest time to be removed. |
[in] | toTime | The earliest time that will NOT be removed. |
[in] | signal | The signal for the data to be removed (system, carrier, code, nav). |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 131 of file MultiFormatNavDataFactory.cpp.
|
staticprotected |
Known nav data factories, organized by signal to make searches simpler and/or quicker. Declared static so that other libraries can transparently add factories.
Definition at line 525 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Search the store of each factory in factories to find the navigation message that meets the specified criteria. The first successful match is returned.
[in] | nmid | Specify the message type, satellite and codes to match. |
[in] | when | The time of interest to search for data. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[out] | navOut | The resulting navigation message. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
[in] | order | Specify whether to search by receiver behavior or by nearest to when in time. |
Implements gnsstk::NavDataFactory.
Definition at line 66 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Obtain a set of satellites+message types for which we have data in the given time span.
[in] | fromTime | The earliest time for which any messages should be available. |
[in] | toTime | The earliest time for which any messages should be NOT available. |
Implements gnsstk::NavDataFactory.
Definition at line 246 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Obtain a set of satellites for which we have data in the given time span.
[in] | fromTime | The earliest time for which any messages should be available. |
[in] | toTime | The earliest time for which any messages should be NOT available. |
Implements gnsstk::NavDataFactory.
Definition at line 210 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Obtain a set of satellites for which we have data of a specific message type in the given time span.
[in] | nmt | The navigation message type you're looking for. |
[in] | fromTime | The earliest time for which any messages should be available. |
[in] | toTime | The earliest time for which any messages should be NOT available. |
Implements gnsstk::NavDataFactory.
Definition at line 227 of file MultiFormatNavDataFactory.cpp.
std::shared_ptr< Fact > gnsstk::MultiFormatNavDataFactory::getFactory |
Get the instance of a given factory type, specified by the template argument. This allows you to get a specific factory if for some reason you need to tweak its settings.
Definition at line 352 of file MultiFormatNavDataFactory.hpp.
|
overridevirtual |
Return a comma-separated list of formats supported by the factories.
Implements gnsstk::NavDataFactory.
Definition at line 506 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Determine the latest time for which this object can successfully determine the Xvt for any object.
Reimplemented from gnsstk::NavDataFactory.
Definition at line 181 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Determine the earliest time for which this object can successfully determine the Xvt for any object.
Reimplemented from gnsstk::NavDataFactory.
Definition at line 152 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Get the offset, in seconds, to apply to times when converting them from fromSys to toSys.
[in] | fromSys | The time system to convert from. |
[in] | toSys | The time system to convert to. |
[in] | when | The time being converted, usually in the time system appropriate for a given nav message source. The details of what time system this should be in and any other restrictions will be documented in each leaf class, e.g. GPSLNavTimeOffset. |
[out] | offset | The offset when converting fromSys->toSys where when(toSys)=when(fromSys)-offset. |
[in] | xmitHealth | The desired health status of the transmitting satellite. |
[in] | valid | Specify whether to search only for valid or invalid messages, or both. |
Implements gnsstk::NavDataFactory.
Definition at line 93 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Determine if a given message/satellite/signal is available in the factory.
[in] | nmid | The message/satellite/signal to search for. |
[in] | fromTime | The earliest time for which a matching message should be available. |
[in] | toTime | The latest time for which a matching message should be available. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 264 of file MultiFormatNavDataFactory.cpp.
|
inlineoverrideprivatevirtual |
This method makes no sense in this context, because we don't want to load, e.g. RINEX and SP3 into the same NavMessageMap, because SP3's find method performs interpolation.
Implements gnsstk::NavDataFactoryWithStoreFile.
Definition at line 342 of file MultiFormatNavDataFactory.hpp.
|
overridevirtual |
Return the number of distinct signals including PRN, in factories.
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 342 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Return the number of distinct signals (ignoring PRN) in factories.
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 318 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Process the data in the specified file using a custom callback. Each message decoded by the factory class will be run through NavDataFactoryCallback::process(). It is expected that the user will derive a class from NavDataFactoryCallback, implement the details of the process method to suit their use case, and apply it here.
[in] | filename | The path of the file to process. |
[in] | cb | The call back to use to process the data in the file. |
Implements gnsstk::NavDataFactoryWithStoreFile.
Definition at line 462 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Set the configuration parameters for this and any child NavDataFactory or PNBNavDataFactory objects.
[in] | ctrl | The configuration for the factory/factories. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 495 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Indicate what nav message types the factories should be loading. This should be called before the factories acquire any data.
[in] | nmts | The set of nav message types to be processed by the factories. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 380 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Set all the contained factories' handling of valid and invalid navigation data. This should be called before any find() calls.
[in] | nvt | The new nav data loading filter method. |
Reimplemented from gnsstk::NavDataFactory.
Definition at line 366 of file MultiFormatNavDataFactory.cpp.
|
overridevirtual |
Return the number of nav messages in all factories.
Reimplemented from gnsstk::NavDataFactoryWithStore.
Definition at line 278 of file MultiFormatNavDataFactory.cpp.
|
protected |
Keep a cached copy of the shared_ptr to the static NavDataFactoryMap so that windows doesn't destroy it before destroying this.
Definition at line 335 of file MultiFormatNavDataFactory.hpp.