VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtExtendedPropertiesEntityStateRepository Class Reference

DtExtendedPropertiesEntityStateRepository class will interface with extended published data and parameter database and properties list to transfer network extended data to DtRwProperties. More...

Inheritance diagram for DtExtendedPropertiesEntityStateRepository:
Inheritance graph
[legend]

Classes

struct  PropertyDecoderInfo
struct  PropertyEncoderInfo

Public Types

typedef void(* PropertyDecoder )(const char *buffer, unsigned size, int version, void *usr)
typedef void(* PropertyEncoder )(std::vector< char > &buffer, void *usr)

Public Member Functions

 DtExtendedPropertiesEntityStateRepository ()
 default constructor
virtual ~DtExtendedPropertiesEntityStateRepository ()
 destructor
 DtExtendedPropertiesEntityStateRepository (const DtExtendedPropertiesEntityStateRepository &orig)
 copy constructor
virtual bool isInitialized () const
 Returns true if one of the initialize() functions has been called.
DtExtendedPropertiesEntityStateRepositoryoperator= (const DtExtendedPropertiesEntityStateRepository &orig)
 assignment operator
virtual DtStateRepositoryclone (bool copy=false) const
 Return a copy/empty object of the same type as this.
virtual int compare (const DtExtEntityStateRepository *rhs)
 Compares us against the supplied state repository and returns what's changed.
const DtRwPropertiesstateProperties () const
const DtRwPropertiesparameterProperties () const
virtual DtString uuidString () const
 Returns a string version of the VRF UUID of this object, if it can be determined.
void mapPropertiesToRecordTypes (const DtRwProperties *properties, std::map< unsigned, DtString > &recTypesToAttrNames)
 Maps properties to DIS record types, if configured. Called from constructors.
virtual bool updatePropertiesFromAttributes (bool updatesOnly=true)
 Updates properties with new data from the extended attributes.
virtual void updateAttributesFromProperties ()
 Updates extended attributes from our properties.
virtual void addPropertyDecoder (const DtString &propName, PropertyDecoder decoder, void *usr)
 Adds an additional property and a function that to decode it.
virtual void addPropertyEncoder (const DtString &propName, PropertyEncoder encoder, void *usr)
 Adds an additional property and a function that to encode it.
virtual bool createVrfObjectDataMessage ()
 Allocates myVrfObjectDataMessage, a DtIfVrfObjectData used by VR-Forces as extended VRF object data message information.
virtual void giveOwernshipOfProperties ()
 Tells the state rep to take ownership of the state and parameter properties, giving it responsibility to delete them on destruction.
virtual DtTime lastPropertyEncodeTime () const
 Last time properties were encoded.
virtual DtTime lastPropertyDecodeTime () const
 Last time properties were decoded.
virtual void initialize (DtVrfParameterDb *)
 Initialization functions.
virtual void initialize (DtRwProperties *stateProps, DtRwProperties *paramProps)
 Initializes the state rep with state properties and parameter properties that have have already been initialized.
virtual void initialize ()
 Initializes the state rep without any state or parameter properties.
virtual DtUUID uuid () const
 Convenience functions for accessing the VRF UUID.
virtual void setUuid (const DtUUID &uuid)
- Public Member Functions inherited from DtExtEntityStateRepository
 DtExtEntityStateRepository ()
virtual ~DtExtEntityStateRepository ()
 DtExtEntityStateRepository (const DtExtEntityStateRepository &orig)
DtExtEntityStateRepositoryoperator= (const DtExtEntityStateRepository &orig)
virtual int compareToMostRecent ()
virtual int compareArtParts (const std::list< int > &)
virtual int compareArtParts (const DtArticulatedPart *source, const DtArticulatedPart *target)
virtual bool locationsDifferent (bool updateIfDifferent)
virtual void setDiGuyStateRepository (DtDIGuyObjectStateRepository *diGuyStateRep)
virtual void setBodyWeight (double)
virtual double bodyWeight () const
bool needsVrfDataUpdate () const
 Returns true if the vrf object data has been modified.
void clearVrfDataNeedsUpdate ()
bool hasVrfObjectDataMessage () const
 Returns true if at least on vrf object data message has been processed by this entity.
void setHasVrfObjectDataMessage (bool)
 Sets whether or not has an object data message.
virtual DtExtDiGuyStateRepositoryextDiGuyStateRepository ()
virtual const
DtExtDiGuyStateRepository
extDiGuyStateRepository () const
virtual void createDiGuyStateRep ()
 Overrides the one in base, creates an extended DI-Guy object state repository instead.
virtual bool setupFromVrfObjectData (const DtIfVrfObjectData &data)
virtual void setSendVrfObjectDataRecord (bool shouldSend)
 Whether a separate VrfObjectData message should be sent to convey additional VRF object information.
virtual bool shouldSendVrfObjectDataRecord () const
- Public Member Functions inherited from DtVrfExtensions
 DtVrfExtensions ()
virtual ~DtVrfExtensions ()
 DtVrfExtensions (const DtVrfExtensions &orig)
DtVrfExtensionsoperator= (const DtVrfExtensions &orig)
virtual const DtStringname () const
virtual void setName (const DtString &n)
virtual const DtStringvrfObjectLabel () const
virtual void setVrfObjectLabel (const DtString &l)
virtual const DtStringechelonId () const
virtual void setEchelonId (const DtString &l)
virtual const DtStringoverlayParent () const
virtual void setOverlayParent (const DtString &l)
virtual bool isVrfSimulated () const
virtual void setIsVrfSimulated (bool vrf)
virtual DtU32 vrfSessionId () const
virtual void setVrfSessionId (DtU32 id)
virtual void setVrfMessageVersionSupported (DtU32 id)
virtual DtU32 vrfMessageVersionSupported () const
virtual void setObjectType (const DtObjectType &)
virtual const DtObjectTypeobjectType () const
virtual void setIsSubordinateOfForce (bool b)
virtual bool isSubordinateOfForce () const
virtual int superType () const
virtual void setHasPlan (bool yesNo)
virtual bool hasPlan () const
virtual void setIsCurrentlyTasked (bool yesNo)
virtual bool isCurrentlyTasked () const
virtual void setRulesOfEngagement (const DtString &)
virtual const DtStringrulesOfEngagement () const
virtual void addRangeItem (const DtRangeItem &)
 Adds, removes and returns items in the range item list.
virtual void removeRangeItem (int index)
virtual void setRangeItems (const DtRangeItems &)
const DtRangeItemsrangeItems () const
virtual DtIfVrfObjectDatavrfObjectDataMessage () const
virtual void setIndependentlyTasked (bool yesNo)
virtual bool independentlyTasked () const
virtual void setUnderFire (bool yesNo)
virtual bool underFire () const
virtual void setExecutingPlan (bool yesNo)
virtual bool executingPlan () const
virtual void setExtendedData (const std::map< DtString, DtString > &)
 Gets/sets extended data.
virtual const std::map
< DtString, DtString > & 
extendedData () const
virtual void setExtendedData (const DtString &key, const DtString &value)
virtual DtString extendedData (const DtString &) const
virtual void setBoundingVolume (const DtVector32 &)
 Sets/gets bounding volume and bounding volume offset of an entity.
virtual const DtVector32 & boundingVolume () const
virtual void setBoundingVolumeOffset (const DtVector32 &)
virtual const DtVector32 & boundingVolumeOffset () const

Static Public Member Functions

static
DtExtendedPropertiesEntityStateRepository
create ()
 Create a new state repository.

Protected Member Functions

virtual void initializeVrfObjectDataProperties ()
 Initializes the state rep to handle VRF object data properties.
virtual void encodePropertyIfNeeded (const DtSymbolString &propName, DtReaderWriter *propRw)
 Encode a particular property if an update is needed.
- Protected Member Functions inherited from DtExtEntityStateRepository
virtual void extensionModified ()

Protected Attributes

DtRwPropertiesmyStateProperties
DtRwPropertiesmyParameterProperties
DtVrfParameterDbmyParameterDatabase
DtEntityType myLastCheckedEntityType
bool myOwnsProperties
bool myIsInitialized
std::list< PropertyDecoderInfomyAdditionalDecoders
std::list< PropertyEncoderInfomyAdditionalEncoders
std::vector< charmyPropertyBuffer
DtClock myClock
DtTime myLastEncodeTime
DtTime myLastDecodeTime
DtUUID myUUID
std::map< DtString, DtStringmyExtendedDataCache
 May be updated on access from extended data.
DtRangeItems myRangeItemsCache
- Protected Attributes inherited from DtExtEntityStateRepository
DtExtEntityStateRepositorymyLastCopy
bool myVrfObjectDataUpdated
bool myHasVrfObjectDataMessage
bool mySendVrfObjectDataRec
- Protected Attributes inherited from DtVrfExtensions
DtString myName
DtIfVrfObjectDatamyVrfObjectDataMessage

Static Protected Attributes

static DtRwProperties theEmptyProperties

Detailed Description

DtExtendedPropertiesEntityStateRepository class will interface with extended published data and parameter database and properties list to transfer network extended data to DtRwProperties.

Member Typedef Documentation

typedef void(* DtExtendedPropertiesEntityStateRepository::PropertyDecoder)(const char *buffer, unsigned size, int version, void *usr)
typedef void(* DtExtendedPropertiesEntityStateRepository::PropertyEncoder)(std::vector< char > &buffer, void *usr)

Constructor & Destructor Documentation

DtExtendedPropertiesEntityStateRepository::DtExtendedPropertiesEntityStateRepository ( )

default constructor

virtual DtExtendedPropertiesEntityStateRepository::~DtExtendedPropertiesEntityStateRepository ( )
virtual

destructor

DtExtendedPropertiesEntityStateRepository::DtExtendedPropertiesEntityStateRepository ( const DtExtendedPropertiesEntityStateRepository orig)

copy constructor

Member Function Documentation

virtual void DtExtendedPropertiesEntityStateRepository::initialize ( DtVrfParameterDb )
virtual

Initialization functions.

One of these functions must be called before state properties can be used.Initializes the state rep based on a parameter database. State properties and parameter properties will be initialized based on this database and the entity type of the entity.

virtual void DtExtendedPropertiesEntityStateRepository::initialize ( DtRwProperties stateProps,
DtRwProperties paramProps 
)
virtual

Initializes the state rep with state properties and parameter properties that have have already been initialized.

Does not take ownership of these properties. They must be deleted elsewhere.

virtual void DtExtendedPropertiesEntityStateRepository::initialize ( )
virtual

Initializes the state rep without any state or parameter properties.

No properties will be processed unless you add a property encoder or decoder using addPropertyEncoder or addPropertyDecoder.

virtual bool DtExtendedPropertiesEntityStateRepository::isInitialized ( ) const
virtual

Returns true if one of the initialize() functions has been called.

DtExtendedPropertiesEntityStateRepository& DtExtendedPropertiesEntityStateRepository::operator= ( const DtExtendedPropertiesEntityStateRepository orig)

assignment operator

virtual DtStateRepository* DtExtendedPropertiesEntityStateRepository::clone ( bool  copy = false) const
virtual

Return a copy/empty object of the same type as this.

Reimplemented from makVrfVrlinkExtToolkit::DtStateRepositoryWithExtendedAttributes< DtExtEntityStateRepository >.

virtual int DtExtendedPropertiesEntityStateRepository::compare ( const DtExtEntityStateRepository rhs)
virtual

Compares us against the supplied state repository and returns what's changed.

Reimplemented from DtExtEntityStateRepository.

const DtRwProperties& DtExtendedPropertiesEntityStateRepository::stateProperties ( ) const
inline
const DtRwProperties& DtExtendedPropertiesEntityStateRepository::parameterProperties ( ) const
inline
virtual DtUUID DtExtendedPropertiesEntityStateRepository::uuid ( ) const
virtual

Convenience functions for accessing the VRF UUID.

virtual void DtExtendedPropertiesEntityStateRepository::setUuid ( const DtUUID uuid)
virtual
virtual DtString DtExtendedPropertiesEntityStateRepository::uuidString ( ) const
virtual

Returns a string version of the VRF UUID of this object, if it can be determined.

VRF has multiple ways of sending the UUID. This method only works when the UUID is sent via the object's extendedData. If sent by other means, such as using state properties (which is the default in 4.6 and later), the returned string will be empty.

Reimplemented from DtExtEntityStateRepository.

void DtExtendedPropertiesEntityStateRepository::mapPropertiesToRecordTypes ( const DtRwProperties properties,
std::map< unsigned, DtString > &  recTypesToAttrNames 
)

Maps properties to DIS record types, if configured. Called from constructors.

virtual bool DtExtendedPropertiesEntityStateRepository::updatePropertiesFromAttributes ( bool  updatesOnly = true)
virtual

Updates properties with new data from the extended attributes.

Used to update properties after receiving an object update. If updatesOnly is true (default), only attributes updated since last property update will be processed. Returns true if any properties were updated.

virtual void DtExtendedPropertiesEntityStateRepository::updateAttributesFromProperties ( )
virtual

Updates extended attributes from our properties.

Used to update attributes before publishing an object update.

virtual void DtExtendedPropertiesEntityStateRepository::addPropertyDecoder ( const DtString propName,
PropertyDecoder  decoder,
void *  usr 
)
virtual

Adds an additional property and a function that to decode it.

Can be used to extend this class to look for additional properties that are not defined in the parameter database for the entity. Is also used by default for VRF object data. Properties will be decoded in the order in which the decoders are added to the list.

virtual void DtExtendedPropertiesEntityStateRepository::addPropertyEncoder ( const DtString propName,
PropertyEncoder  encoder,
void *  usr 
)
virtual

Adds an additional property and a function that to encode it.

Can be used to extend this class to look for additional properties that are not defined in the parameter database for the entity. Is also used by default for VRF object data. Properties will be encoded in the order in which the encoders are added to the list.

virtual bool DtExtendedPropertiesEntityStateRepository::createVrfObjectDataMessage ( )
virtual

Allocates myVrfObjectDataMessage, a DtIfVrfObjectData used by VR-Forces as extended VRF object data message information.

Overrides the default version to create a DtIfVrfObjectDataStateProperties, which can be more efficiently updated from state properties.

Reimplemented from DtVrfExtensions.

virtual void DtExtendedPropertiesEntityStateRepository::giveOwernshipOfProperties ( )
virtual

Tells the state rep to take ownership of the state and parameter properties, giving it responsibility to delete them on destruction.

static DtExtendedPropertiesEntityStateRepository* DtExtendedPropertiesEntityStateRepository::create ( )
static
virtual DtTime DtExtendedPropertiesEntityStateRepository::lastPropertyEncodeTime ( ) const
inlinevirtual

Last time properties were encoded.

virtual DtTime DtExtendedPropertiesEntityStateRepository::lastPropertyDecodeTime ( ) const
inlinevirtual

Last time properties were decoded.

virtual void DtExtendedPropertiesEntityStateRepository::initializeVrfObjectDataProperties ( )
protectedvirtual

Initializes the state rep to handle VRF object data properties.

virtual void DtExtendedPropertiesEntityStateRepository::encodePropertyIfNeeded ( const DtSymbolString propName,
DtReaderWriter propRw 
)
protectedvirtual

Encode a particular property if an update is needed.

Member Data Documentation

DtRwProperties* DtExtendedPropertiesEntityStateRepository::myStateProperties
protected
DtRwProperties* DtExtendedPropertiesEntityStateRepository::myParameterProperties
protected
DtVrfParameterDb* DtExtendedPropertiesEntityStateRepository::myParameterDatabase
protected
DtEntityType DtExtendedPropertiesEntityStateRepository::myLastCheckedEntityType
protected
bool DtExtendedPropertiesEntityStateRepository::myOwnsProperties
protected
bool DtExtendedPropertiesEntityStateRepository::myIsInitialized
protected
std::list<PropertyDecoderInfo> DtExtendedPropertiesEntityStateRepository::myAdditionalDecoders
protected
std::list<PropertyEncoderInfo> DtExtendedPropertiesEntityStateRepository::myAdditionalEncoders
protected
std::vector<char> DtExtendedPropertiesEntityStateRepository::myPropertyBuffer
protected
DtClock DtExtendedPropertiesEntityStateRepository::myClock
protected
DtTime DtExtendedPropertiesEntityStateRepository::myLastEncodeTime
protected
DtTime DtExtendedPropertiesEntityStateRepository::myLastDecodeTime
protected
DtUUID DtExtendedPropertiesEntityStateRepository::myUUID
mutableprotected
std::map<DtString, DtString> DtExtendedPropertiesEntityStateRepository::myExtendedDataCache
mutableprotected

May be updated on access from extended data.

DtRangeItems DtExtendedPropertiesEntityStateRepository::myRangeItemsCache
mutableprotected
DtRwProperties DtExtendedPropertiesEntityStateRepository::theEmptyProperties
staticprotected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)