MAK RTIspy API Documentation for HLA Evolved
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions

Stores the cached connections which the Assistant can provide to components if necessary. More...

+ Collaboration diagram for DtConnectionCache:

List of all members.

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.
DtConnectionCacheoperator= (const DtConnectionCache &)

Detailed Description

Stores the cached connections which the Assistant can provide to components if necessary.

Handles reading and loading this information from an XML file.


Constructor & Destructor Documentation

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.

Destructor.

Copy and assignment not allowed.


Member Function Documentation

MAKRti::DtEnvValueSP DtConnectionCache::addConfigurationToEnv ( const DtRtiConfigurationInfoDataPair config) [protected, virtual]
MAKRti::DtEnvValueSP DtConnectionCache::addConnectionToEnv ( const DtRtiConnectionInfoDataPair conn) [protected, 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]
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::getRtiexecConnectionsFromEnv ( DtRtiConnectionAndConfiguration connsAndConfigs) [protected, 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]

Prints the cache to the given output stream.

References myEnvironment.

Referenced by operator<<().

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().

void DtConnectionCache::setConnFromEnv ( DtRtiConnectionInfoDataPair conn,
MAKRti::DtEnvValueSP  val 
) [protected]

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.


Member Data Documentation

MAKRti::DtEnvironment DtConnectionCache::myEnvironment [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().

The predefined lightweight configuration.

Referenced by getConfigurationsFromEnv().

MAKRti::DtString DtConnectionCache::thePredefinedLightweightConfigName [static, protected]

The predefined lightweight configuration name.

Referenced by getConfigurationsFromEnv().

The predefined lightweight connection.

Referenced by getLightweightConnectionsFromEnv().

MAKRti::DtString DtConnectionCache::thePredefinedLightweightConnName [static, protected]

The predefined lightweight connection name.

Referenced by getLightweightConnectionsFromEnv().

The predefined rtiexec configuration.

Referenced by getConfigurationsFromEnv().

MAKRti::DtString DtConnectionCache::thePredefinedRtiexecConfigName [static, protected]

The predefined rtiexec configuration name.

Referenced by getConfigurationsFromEnv().

The predefined rtiexec connection.

Referenced by getRtiexecConnectionsFromEnv().

MAKRti::DtString DtConnectionCache::thePredefinedRtiexecConnName [static, protected]

The predefined rtiexec connection name.

Referenced by getRtiexecConnectionsFromEnv().


The documentation for this class was generated from the following files:

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)