VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
DtStateRepository Class Reference

DtStateRepository is an abstract base class for maintaining state for an object. More...

+ Inheritance diagram for DtStateRepository:
+ Collaboration diagram for DtStateRepository:

Public Types

typedef std::map< DtString,
DtStateRepositoryExtension * > 
DtStateRepositoryExtensionMap
 

Public Member Functions

 DtStateRepository ()
 default constructor More...
 
 DtStateRepository (const DtStateRepository &orig)
 copy constructor More...
 
virtual ~DtStateRepository ()
 destructor More...
 
DtStateRepositoryoperator= (const DtStateRepository &orig)
 assignment operator More...
 
virtual DtStateRepositoryclone (bool copy=false) const
 Return a copy/empty object of the same type as this. More...
 
virtual void printData () const
 Print State Data to the DtInfo Stream. More...
 
virtual void printDataToStream (std::ostream &stream) const
 Prints the State Data to the stream specified. More...
 
virtual void setGlobalId (const DtGlobalObjectDesignator &id)
 Get/Set global identifier, or name. More...
 
virtual const
DtGlobalObjectDesignator
globalId () const
 
virtual unsigned int numberOfAttributeRecords () const
 
virtual void setAttributeRecords (const DtAttributeRecordSet &records)
 The following functions are related to the extendability part of DIS 7. More...
 
virtual void setAttributeRecords (const DtStandardVariableRecordPtrVector &records)
 Replace the attribute record set with the records in the given vector. More...
 
virtual const
DtAttributeRecordSet
attributeRecordSet () const
 Return the attribute record set. More...
 
virtual DtAttributeRecordSetattributeRecordSet ()
 Return the attribute record set. More...
 
virtual const
DtStandardVariableRecordPtrVector
attributeRecords () const
 Return the attribute records Any changes to the returned record(s) will modify the records in the recordSet. More...
 
virtual const
DtStandardVariableRecordPtrVector
attributeRecords (unsigned int recordType) const
 Return the attribute records of the given type (all records if type is 0) Any changes to the returned record(s) will modify the records in the recordSet. More...
 
virtual DtStandardVariableRecordattributeRecord (unsigned int recordType) const
 Return the (first) attribute record of the given type (first record if type is 0) Any changes to the returned record will modify the record in the recordSet. More...
 
virtual int removeAttributeRecord (unsigned int recordType, bool removeAll=true)
 Remove and discard the first record of the given record type (if there is one) or all them. More...
 
virtual
DtStandardVariableRecordPtrVector
getAttributeRecords (unsigned int recordType, DtStandardVariableRecordPtrVector &vec) const
 Get the attribute records of the given type (all if type is 0) Any changes to the returned record(s) will modify the records in the recordSet. More...
 
virtual
DtStandardVariableRecordPtrVector
getAttributeRecords (DtStandardVariableRecordPtrVector &vec) const
 Get the attribute records Any changes to the returned record(s) will modify the records in the recordSet. More...
 
virtual void addAttributeRecord (DtStandardVariableRecord *record)
 Add a clone of given record to the attribute record set. More...
 
virtual void addAttributeRecord (std::unique_ptr< DtStandardVariableRecord > record)
 Add the given record to the attribute record set. More...
 
virtual void clearAttributeRecords ()
 Clear all records. More...
 

Public Attributes

DtGlobalObjectDesignator myGlobalId
 
DtAttributeRecordSet myAttributeRecords
 
DtStandardVariableRecordPtrVector myReturnedRecords
 
DtStateRepositoryExtensionMap myStateRepositoryExtensionMap
 

Static Public Attributes

static std::map< DtString,
DtSrExtCreatorFnc
theStateRepositoryExtensionCreatorMap
 
virtual
DtStateRepositoryExtension
stateRepositoryExtension (DtString srExtName) const
 Returns pointer to a DtStateRepositoryExtension object with the given name Returns 0 if no extension with given name is found. More...
 
virtual std::vector< DtStringstateRepositoryExtensionNames () const
 Returns a set of the registered state repository extension names. More...
 
virtual void setStateRepositoryExtensions (std::map< DtString, DtStateRepositoryExtension * > extensions)
 Returns pointer to a DtStateRepositoryExtension object with the given name Returns 0 if no extension with given name is found. More...
 
virtual const std::map
< DtString,
DtStateRepositoryExtension * > 
stateRepositoryExtensions () const
 Returns pointer to a DtStateRepositoryExtension object with the given name Returns 0 if no extension with given name is found. More...
 
static bool addStateRepositoryExtension (DtString srExtName, DtSrExtCreatorFnc fnc)
 The following functions are for extending state repositories through State Repository Extension classes. More...
 

Detailed Description

DtStateRepository is an abstract base class for maintaining state for an object.

Instances of DtStateRepository subclasses are used to store state for specific object types, such as vehicles or lifeforms.

Member Typedef Documentation

Constructor & Destructor Documentation

DtStateRepository::DtStateRepository ( )

default constructor

DtStateRepository::DtStateRepository ( const DtStateRepository orig)

copy constructor

virtual DtStateRepository::~DtStateRepository ( )
virtual

destructor

Member Function Documentation

virtual void DtStateRepository::addAttributeRecord ( DtStandardVariableRecord record)
virtual

Add a clone of given record to the attribute record set.

Reimplemented in DtEmitterSystemRepository.

virtual void DtStateRepository::addAttributeRecord ( std::unique_ptr< DtStandardVariableRecord record)
virtual

Add the given record to the attribute record set.

static bool DtStateRepository::addStateRepositoryExtension ( DtString  srExtName,
DtSrExtCreatorFnc  fnc 
)
static

The following functions are for extending state repositories through State Repository Extension classes.

Adds the State Repository Creator function to the creator function list return value indicates whether the add was successful or not

virtual DtStandardVariableRecord* DtStateRepository::attributeRecord ( unsigned int  recordType) const
virtual

Return the (first) attribute record of the given type (first record if type is 0) Any changes to the returned record will modify the record in the recordSet.

virtual const DtStandardVariableRecordPtrVector& DtStateRepository::attributeRecords ( ) const
virtual

Return the attribute records Any changes to the returned record(s) will modify the records in the recordSet.

Reimplemented in DtEmitterSystemRepository.

virtual const DtStandardVariableRecordPtrVector& DtStateRepository::attributeRecords ( unsigned int  recordType) const
virtual

Return the attribute records of the given type (all records if type is 0) Any changes to the returned record(s) will modify the records in the recordSet.

Reimplemented in DtEmitterSystemRepository.

virtual const DtAttributeRecordSet& DtStateRepository::attributeRecordSet ( ) const
virtual

Return the attribute record set.

virtual DtAttributeRecordSet& DtStateRepository::attributeRecordSet ( )
virtual

Return the attribute record set.

virtual void DtStateRepository::clearAttributeRecords ( )
virtual

Clear all records.

Reimplemented in DtEmitterSystemRepository.

virtual DtStateRepository* DtStateRepository::clone ( bool  copy = false) const
virtual
virtual DtStandardVariableRecordPtrVector& DtStateRepository::getAttributeRecords ( unsigned int  recordType,
DtStandardVariableRecordPtrVector vec 
) const
virtual

Get the attribute records of the given type (all if type is 0) Any changes to the returned record(s) will modify the records in the recordSet.

Reimplemented in DtEmitterSystemRepository.

virtual DtStandardVariableRecordPtrVector& DtStateRepository::getAttributeRecords ( DtStandardVariableRecordPtrVector vec) const
virtual

Get the attribute records Any changes to the returned record(s) will modify the records in the recordSet.

virtual const DtGlobalObjectDesignator& DtStateRepository::globalId ( ) const
virtual
virtual unsigned int DtStateRepository::numberOfAttributeRecords ( ) const
virtual
DtStateRepository& DtStateRepository::operator= ( const DtStateRepository orig)

assignment operator

virtual void DtStateRepository::printData ( ) const
virtual
virtual void DtStateRepository::printDataToStream ( std::ostream &  stream) const
virtual
virtual int DtStateRepository::removeAttributeRecord ( unsigned int  recordType,
bool  removeAll = true 
)
virtual

Remove and discard the first record of the given record type (if there is one) or all them.

Return the number of records removed

virtual void DtStateRepository::setAttributeRecords ( const DtAttributeRecordSet records)
virtual

The following functions are related to the extendability part of DIS 7.

Manager attribute records Replace the attribute record set with the given one

virtual void DtStateRepository::setAttributeRecords ( const DtStandardVariableRecordPtrVector records)
virtual

Replace the attribute record set with the records in the given vector.

Reimplemented in DtEmitterSystemRepository.

virtual void DtStateRepository::setGlobalId ( const DtGlobalObjectDesignator id)
virtual

Get/Set global identifier, or name.

Set by VR-Link for reflected objects. Not necessary to set for local objects.

virtual void DtStateRepository::setStateRepositoryExtensions ( std::map< DtString, DtStateRepositoryExtension * >  extensions)
virtual

Returns pointer to a DtStateRepositoryExtension object with the given name Returns 0 if no extension with given name is found.

virtual DtStateRepositoryExtension* DtStateRepository::stateRepositoryExtension ( DtString  srExtName) const
virtual

Returns pointer to a DtStateRepositoryExtension object with the given name Returns 0 if no extension with given name is found.

virtual std::vector<DtString> DtStateRepository::stateRepositoryExtensionNames ( ) const
virtual

Returns a set of the registered state repository extension names.

virtual const std::map<DtString, DtStateRepositoryExtension*> DtStateRepository::stateRepositoryExtensions ( ) const
virtual

Returns pointer to a DtStateRepositoryExtension object with the given name Returns 0 if no extension with given name is found.

Member Data Documentation

DtAttributeRecordSet DtStateRepository::myAttributeRecords
DtGlobalObjectDesignator DtStateRepository::myGlobalId
DtStandardVariableRecordPtrVector DtStateRepository::myReturnedRecords
mutable
DtStateRepositoryExtensionMap DtStateRepository::myStateRepositoryExtensionMap
std::map<DtString, DtSrExtCreatorFnc> DtStateRepository::theStateRepositoryExtensionCreatorMap
static

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

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)