![]() |
MAK RTIspy API Documentation for HLA Evolved
|
Stores the cached connections which the Assistant can provide to components if necessary. More...
Collaboration diagram for DtConnectionCache:Public Member Functions | |
| DtConnectionCache (const MAKRti::DtFilename &xmlFile) | |
| Constructor. | |
| virtual | ~DtConnectionCache () |
| Destructor. | |
| virtual bool | writeToFile () |
| Writes the cache to the default XML file specified at creation. | |
| virtual bool | writeToFile (const MAKRti::DtFilename &xmlFile) |
| Writes the cache to the specified XML file. Returns true if successful. | |
| virtual std::ostream & | print (std::ostream &ostr) const |
| Prints the cache to the given output stream. | |
| virtual void | getConnections (DtRtiConnectionAndConfiguration &connsAndConfigs) |
| Retrieve the connections. | |
| virtual bool | setConnections (const DtRtiConnectionAndConfiguration &conns) |
| Set the connections. Returns true on success. | |
| virtual void | clearConnections () |
| Clear all connections. | |
| virtual bool | fileWasRead () const |
| Returns true if the cache file was found and read. | |
| virtual bool | getFileVersion (MAKRti::DtString &version) const |
| Returns the RTI version of the file that was read. | |
| virtual bool | isCacheVersionOld () const |
| Was the cache read from an older file version? | |
Protected Member Functions | |
| virtual void | getRtiexecConnectionsFromEnv (DtRtiConnectionAndConfiguration &connsAndConfigs) |
| Retrieve the rtiexec connections from the XML environment. | |
| virtual void | getLightweightConnectionsFromEnv (DtRtiConnectionAndConfiguration &connsAndConfigs) |
| Retrieve the lightweight connections from the XML environment. | |
| virtual void | getConfigurationsFromEnv (DtRtiConnectionAndConfiguration &connsAndConfigs) |
| Retrieves the configurations from the XML environment. | |
| virtual MAKRti::DtEnvValueSP | addConnectionToEnv (const DtRtiConnectionInfoDataPair &conn) |
| Add a connection/config to the XML environment. | |
| virtual MAKRti::DtEnvValueSP | addConfigurationToEnv (const DtRtiConfigurationInfoDataPair &config) |
| virtual void | removeConnectionFromEnv (const DtRtiConnectionInfoDataPair &conn) |
| Remove a connection from the XML environment. | |
| virtual void | removeConfigurationFromEnv (const DtRtiConfigurationInfoDataPair &config) |
| void | setConnFromEnv (DtRtiConnectionInfoDataPair &conn, MAKRti::DtEnvValueSP val) |
| Sets the connection info from the environment value. | |
| void | setConfigFromEnv (DtRtiConfigurationInfoDataPair &config, MAKRti::DtEnvValueSP val) |
| Sets the connection info from the environment value. | |
| bool | parseFile (const MAKRti::DtFilename &filename) |
| Build document starting from existing file Non-virtual since this may be called from the constructor. | |
Protected Attributes | |
| MAKRti::DtEnvironment | myEnvironment |
| The cached license environment. | |
| std::auto_ptr < MAKRti::DtEnvXMLWriter > | myXmlWriter |
| Document writer - used to convert the document to XML in memory or file myXmlWriter is persistent so that the XML memory buffer does not re-allocate as often. | |
| MAKRti::DtFilename | myXmlFile |
| The name of the default XML file to read from and write to. | |
| MAKRti::DtString | myReadFileVersion |
| The version of the file that was read. | |
| bool | myFileWasRead |
| Indicates whether a cache file was found and read. | |
Static Protected Attributes | |
| static MAKRti::DtString | thePredefinedLightweightConnName |
| The predefined lightweight connection name. | |
| static DtRtiConnectionInfo | thePredefinedLightweightConn |
| The predefined lightweight connection. | |
| static MAKRti::DtString | thePredefinedRtiexecConnName |
| The predefined rtiexec connection name. | |
| static DtRtiConnectionInfo | thePredefinedRtiexecConn |
| The predefined rtiexec connection. | |
| static MAKRti::DtString | thePredefinedLightweightConfigName |
| The predefined lightweight configuration name. | |
| static DtRtiConnectionConfigurationInfo | thePredefinedLightweightConfig |
| The predefined lightweight configuration. | |
| static MAKRti::DtString | thePredefinedRtiexecConfigName |
| The predefined rtiexec configuration name. | |
| static DtRtiConnectionConfigurationInfo | thePredefinedRtiexecConfig |
| The predefined rtiexec configuration. | |
Private Member Functions | |
| DtConnectionCache (const DtConnectionCache &) | |
| Copy and assignment not allowed. | |
| DtConnectionCache & | operator= (const DtConnectionCache &) |
Stores the cached connections which the Assistant can provide to components if necessary.
Handles reading and loading this information from an XML file.
| DtConnectionCache::DtConnectionCache | ( | const MAKRti::DtFilename & | xmlFile | ) |
Constructor.
Creates an Assistant connections cache from the given XML file. If the file cannot be found, an empty cache is created. In this case the file name will be saved as the default file if the cache needs to be written later.
References DtConnectionsVersionString, myEnvironment, myFileWasRead, myReadFileVersion, and myXmlFile.
| DtConnectionCache::~DtConnectionCache | ( | ) | [virtual] |
Destructor.
| DtConnectionCache::DtConnectionCache | ( | const DtConnectionCache & | ) | [private] |
Copy and assignment not allowed.
| MAKRti::DtEnvValueSP DtConnectionCache::addConfigurationToEnv | ( | const DtRtiConfigurationInfoDataPair & | config | ) | [protected, virtual] |
References DtConnectionsChosenString, DtConnectionsConfigString, DtConnectionsFullyCompliantString, and myEnvironment.
Referenced by setConnections().
| MAKRti::DtEnvValueSP DtConnectionCache::addConnectionToEnv | ( | const DtRtiConnectionInfoDataPair & | conn | ) | [protected, virtual] |
Add a connection/config to the XML environment.
References DtConnectionsAdditionalForwarderConnString, DtConnectionsBestEffortIPString, DtConnectionsBestEffortPortString, DtConnectionsChosenString, DtConnectionsForwarderPortString, DtConnectionsGivenNameString, DtConnectionsHostString, DtConnectionsLightweightString, DtConnectionsNetworkInterfaceAddrString, DtConnectionsOwnerHostString, DtConnectionsReliableIPString, DtConnectionsReliablePortString, DtConnectionsRtiExecString, and myEnvironment.
Referenced by setConnections().
| void DtConnectionCache::clearConnections | ( | ) | [virtual] |
Clear all connections.
References DtConnectionsConnectionString, and myEnvironment.
| bool DtConnectionCache::fileWasRead | ( | ) | const [virtual] |
Returns true if the cache file was found and read.
References myFileWasRead.
| void DtConnectionCache::getConfigurationsFromEnv | ( | DtRtiConnectionAndConfiguration & | connsAndConfigs | ) | [protected, virtual] |
Retrieves the configurations from the XML environment.
References DtRtiConnectionAndConfiguration::addConfiguration(), DtRtiConnectionAndConfiguration::connections(), DtConnectionsConfigString, myEnvironment, setConfigFromEnv(), DtRtiConnectionAndConfiguration::setConnectionConfigMapping(), thePredefinedLightweightConfig, thePredefinedLightweightConfigName, thePredefinedRtiexecConfig, and thePredefinedRtiexecConfigName.
Referenced by getConnections().
| void DtConnectionCache::getConnections | ( | DtRtiConnectionAndConfiguration & | connsAndConfigs | ) | [virtual] |
Retrieve the connections.
References getConfigurationsFromEnv(), getLightweightConnectionsFromEnv(), and getRtiexecConnectionsFromEnv().
| bool DtConnectionCache::getFileVersion | ( | MAKRti::DtString & | version | ) | const [virtual] |
Returns the RTI version of the file that was read.
Returns false if no file was read.
References myFileWasRead, and myReadFileVersion.
Referenced by isCacheVersionOld().
| void DtConnectionCache::getLightweightConnectionsFromEnv | ( | DtRtiConnectionAndConfiguration & | connsAndConfigs | ) | [protected, virtual] |
Retrieve the lightweight connections from the XML environment.
References DtRtiConnectionAndConfiguration::addConnection(), DtConnectionsLightweightString, DtGetLocalHostName(), DtRtiAssociatedConnectionData::DtUnknownState, DtRtiConnectionAndConfiguration::findConnection(), myEnvironment, DtRtiAssociatedConnectionData::setConnectionState(), setConnFromEnv(), DtRtiAssociatedConnectionData::setIsChosen(), DtRtiAssociatedConnectionData::setIsPredefined(), DtRtiAssociatedConnectionData::setIsSaved(), DtRtiAssociatedConnectionData::setName(), DtRtiAssociatedConnectionData::setOptionalForwarderToConnectTo(), DtRtiAssociatedConnectionData::setOwnerHost(), thePredefinedLightweightConn, thePredefinedLightweightConnName, and DtRtiConnectionAndConfiguration::updateConnectionAssociatedDataOnly().
Referenced by getConnections().
| void DtConnectionCache::getRtiexecConnectionsFromEnv | ( | DtRtiConnectionAndConfiguration & | connsAndConfigs | ) | [protected, virtual] |
Retrieve the rtiexec connections from the XML environment.
References DtRtiConnectionAndConfiguration::addConnection(), DtConnectionsRtiExecString, DtGetLocalHostName(), DtRtiAssociatedConnectionData::DtUnknownState, DtRtiConnectionAndConfiguration::findConnection(), myEnvironment, DtRtiAssociatedConnectionData::setConnectionState(), setConnFromEnv(), DtRtiAssociatedConnectionData::setIsChosen(), DtRtiAssociatedConnectionData::setIsPredefined(), DtRtiAssociatedConnectionData::setIsSaved(), DtRtiAssociatedConnectionData::setName(), DtRtiAssociatedConnectionData::setOptionalForwarderToConnectTo(), DtRtiAssociatedConnectionData::setOwnerHost(), thePredefinedRtiexecConn, thePredefinedRtiexecConnName, and DtRtiConnectionAndConfiguration::updateConnectionAssociatedDataOnly().
Referenced by getConnections().
| bool DtConnectionCache::isCacheVersionOld | ( | ) | const [virtual] |
Was the cache read from an older file version?
References DtRtiVersionNumber, and getFileVersion().
| DtConnectionCache& DtConnectionCache::operator= | ( | const DtConnectionCache & | ) | [private] |
| bool DtConnectionCache::parseFile | ( | const MAKRti::DtFilename & | filename | ) | [protected] |
Build document starting from existing file Non-virtual since this may be called from the constructor.
| std::ostream & DtConnectionCache::print | ( | std::ostream & | ostr | ) | const [virtual] |
| void DtConnectionCache::removeConfigurationFromEnv | ( | const DtRtiConfigurationInfoDataPair & | config | ) | [protected, virtual] |
References DtConnectionsConfigString, and myEnvironment.
| void DtConnectionCache::removeConnectionFromEnv | ( | const DtRtiConnectionInfoDataPair & | conn | ) | [protected, virtual] |
Remove a connection from the XML environment.
References DtConnectionsLightweightString, DtConnectionsRtiExecString, and myEnvironment.
| void DtConnectionCache::setConfigFromEnv | ( | DtRtiConfigurationInfoDataPair & | config, |
| MAKRti::DtEnvValueSP | val | ||
| ) | [protected] |
Sets the connection info from the environment value.
References DtConnectionsChosenString, DtConnectionsFullyCompliantString, and myEnvironment.
Referenced by getConfigurationsFromEnv().
| bool DtConnectionCache::setConnections | ( | const DtRtiConnectionAndConfiguration & | conns | ) | [virtual] |
Set the connections. Returns true on success.
References addConfigurationToEnv(), addConnectionToEnv(), DtRtiConnectionAndConfiguration::configs(), DtRtiConnectionAndConfiguration::connections(), DtConnectionsVersionString, DtRtiVersionNumber, and myEnvironment.
| void DtConnectionCache::setConnFromEnv | ( | DtRtiConnectionInfoDataPair & | conn, |
| MAKRti::DtEnvValueSP | val | ||
| ) | [protected] |
Sets the connection info from the environment value.
References DtConnectionsAdditionalForwarderConnString, DtConnectionsBestEffortIPString, DtConnectionsBestEffortPortString, DtConnectionsChosenString, DtConnectionsForwarderPortString, DtConnectionsGivenNameString, DtConnectionsHostString, DtConnectionsNetworkInterfaceAddrString, DtConnectionsOwnerHostString, DtConnectionsPortString, DtConnectionsReliableIPString, DtConnectionsReliablePortString, DtDefaultInterfaceAddr(), DtGetLocalHostName(), and myEnvironment.
Referenced by getLightweightConnectionsFromEnv(), and getRtiexecConnectionsFromEnv().
| bool DtConnectionCache::writeToFile | ( | ) | [virtual] |
Writes the cache to the default XML file specified at creation.
Returns true if successful.
References myXmlFile.
| bool DtConnectionCache::writeToFile | ( | const MAKRti::DtFilename & | xmlFile | ) | [virtual] |
Writes the cache to the specified XML file. Returns true if successful.
References myEnvironment, and myXmlWriter.
MAKRti::DtEnvironment DtConnectionCache::myEnvironment [protected] |
The cached license environment.
Referenced by addConfigurationToEnv(), addConnectionToEnv(), clearConnections(), DtConnectionCache(), getConfigurationsFromEnv(), getLightweightConnectionsFromEnv(), getRtiexecConnectionsFromEnv(), print(), removeConfigurationFromEnv(), removeConnectionFromEnv(), setConfigFromEnv(), setConnections(), setConnFromEnv(), and writeToFile().
bool DtConnectionCache::myFileWasRead [protected] |
Indicates whether a cache file was found and read.
Referenced by DtConnectionCache(), fileWasRead(), and getFileVersion().
MAKRti::DtString DtConnectionCache::myReadFileVersion [protected] |
The version of the file that was read.
Referenced by DtConnectionCache(), and getFileVersion().
MAKRti::DtFilename DtConnectionCache::myXmlFile [protected] |
The name of the default XML file to read from and write to.
Referenced by DtConnectionCache(), and writeToFile().
std::auto_ptr< MAKRti::DtEnvXMLWriter > DtConnectionCache::myXmlWriter [protected] |
Document writer - used to convert the document to XML in memory or file myXmlWriter is persistent so that the XML memory buffer does not re-allocate as often.
Referenced by writeToFile().
DtRtiConnectionConfigurationInfo DtConnectionCache::thePredefinedLightweightConfig [static, protected] |
The predefined lightweight configuration.
Referenced by getConfigurationsFromEnv().
MAKRti::DtString DtConnectionCache::thePredefinedLightweightConfigName [static, protected] |
The predefined lightweight configuration name.
Referenced by getConfigurationsFromEnv().
DtRtiConnectionInfo DtConnectionCache::thePredefinedLightweightConn [static, protected] |
The predefined lightweight connection.
Referenced by getLightweightConnectionsFromEnv().
MAKRti::DtString DtConnectionCache::thePredefinedLightweightConnName [static, protected] |
The predefined lightweight connection name.
Referenced by getLightweightConnectionsFromEnv().
DtRtiConnectionConfigurationInfo DtConnectionCache::thePredefinedRtiexecConfig [static, protected] |
The predefined rtiexec configuration.
Referenced by getConfigurationsFromEnv().
MAKRti::DtString DtConnectionCache::thePredefinedRtiexecConfigName [static, protected] |
The predefined rtiexec configuration name.
Referenced by getConfigurationsFromEnv().
DtRtiConnectionInfo DtConnectionCache::thePredefinedRtiexecConn [static, protected] |
The predefined rtiexec connection.
Referenced by getRtiexecConnectionsFromEnv().
MAKRti::DtString DtConnectionCache::thePredefinedRtiexecConnName [static, protected] |
The predefined rtiexec connection name.
Referenced by getRtiexecConnectionsFromEnv().