VR-Forces 4.8 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
DtExtEntityStateRepository Class Reference

DtExtEntityStateRepository class extends the DtExtEntityBaseStateRepository to be able to handle extended attributes. More...

Inheritance diagram for DtExtEntityStateRepository:
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

 DtExtEntityStateRepository ()
 Default CTOR. More...
 
 DtExtEntityStateRepository (const DtExtEntityStateRepository &orig)
 Copy CTOR. More...
 
virtual ~DtExtEntityStateRepository ()
 Virtual DTOR. More...
 
virtual bool isInitialized () const
 Returns true if one of the initialize() functions has been called. More...
 
DtExtEntityStateRepositoryoperator= (const DtExtEntityStateRepository &orig)
 Assignment operator. More...
 
virtual DtStateRepositoryclone (bool copy=false) const
 Return a copy/empty object of the same type as this. More...
 
virtual int compare (const DtExtEntityStateRepository *rhs)
 Compares us against the supplied state repository and returns what's changed. More...
 
virtual const DtRwPropertiesstateProperties () const
 
virtual const DtRwPropertiesparameterProperties () const
 
virtual void setDiGuyAction (const DtString &val, bool paused, double speed=0.0, bool usePositioning=false, const DtVector &offset=DtVector(0, 0, 0))
 DI-Guy extension. Set action with offset. More...
 
virtual void setBodyWeight (double)
 DI-Guy extension. Get/set body weight. More...
 
virtual double bodyWeight () const
 
virtual void setUuidString (const DtString &uuidStr)
 
virtual DtString uuidString () const
 Returns a string version of the VRF UUID of this object, if it can be determined. More...
 
void mapPropertiesToRecordTypes (const DtRwProperties *properties, std::map< unsigned, DtString > &recTypesToAttrNames)
 Maps properties to DIS record types, if configured. Called from constructors. More...
 
virtual bool updatePropertiesFromAttributes (bool updatesOnly=true)
 Updates properties with new data from the extended attributes. More...
 
virtual void updateAttributesFromProperties ()
 Updates extended attributes from our properties. More...
 
virtual void addPropertyDecoder (const DtString &propName, PropertyDecoder decoder, void *usr, unsigned disRecordType=0)
 Adds an additional property and a function that to decode it. More...
 
virtual void addPropertyEncoder (const DtString &propName, PropertyEncoder encoder, void *usr, unsigned disRecordType=0)
 Adds an additional property and a function that to encode it. More...
 
virtual void removePropertyEncodersAndDecoders ()
 Removes all additional property encoders and decoders. More...
 
virtual bool createVrfObjectDataMessage ()
 Allocates myVrfObjectDataMessage, a DtIfVrfObjectData used by VR-Forces as extended VRF object data message information. More...
 
virtual void giveOwernshipOfProperties ()
 Tells the state rep to take ownership of the state and parameter properties, giving it responsibility to delete them on destruction. More...
 
virtual DtTime lastPropertyEncodeTime () const
 Last time properties were encoded. More...
 
virtual DtTime lastPropertyDecodeTime () const
 Last time properties were decoded. More...
 
Initialization functions. One of these must be called to support extended attributes.
virtual void initialize (DtRwProperties *stateProps, DtRwProperties *paramProps)
 Initializes the state rep with state properties and parameter properties that have have already been initialized. More...
 
virtual void initialize (const DtRwProperties &stateProps, const DtRwProperties &paramProps)
 Initializes the state rep by making a copy of the given state properties and parameter properties that have have already been initialized. More...
 
virtual void initialize ()
 Initializes the state rep without any state or parameter properties. More...
 
virtual bool sensorsKilled () const
 Functions for accessing the sensors killed state. More...
 
virtual void setSensorsKilled (bool killed)
 
virtual void addPropertyUpdatedCallback (DtNoArgumentCallbackList::DtCallbackFunctionType fcn, void *usrData)
 Callbacks invoked just after state and parameter properties have been updated when the parameter or state properties have been updated. More...
 
virtual void removePropertyUpdatedCallback (DtNoArgumentCallbackList::DtCallbackFunctionType fcn, void *usrData)
 
- Public Member Functions inherited from DtExtEntityBaseStateRepository
 DtExtEntityBaseStateRepository ()
 default constructor More...
 
virtual ~DtExtEntityBaseStateRepository ()
 destructor More...
 
 DtExtEntityBaseStateRepository (const DtExtEntityBaseStateRepository &orig)
 copy constructor More...
 
DtExtEntityBaseStateRepositoryoperator= (const DtExtEntityBaseStateRepository &orig)
 assignment operator More...
 
virtual int compare (const DtExtEntityBaseStateRepository *rhs)
 Compares us against the supplied state repository and returns what's changed. More...
 
virtual int compareToMostRecent ()
 Returns what has changed since the last time we called compare. More...
 
virtual int compareArtParts (const std::list< int > &)
 Compares articulated parts in the local copy to current values and returns a non-zero value if modified. More...
 
virtual int compareArtParts (const DtArticulatedPart *source, const DtArticulatedPart *target)
 Compares each value that is valid, and, if any have changed, returns DtChanged_Other. More...
 
virtual bool locationsDifferent (bool updateIfDifferent)
 Returns true if our stashed location is different than our current location. More...
 
virtual void setDiGuyStateRepository (DtDIGuyObjectStateRepository *diGuyStateRep)
 If the DI guy repository being set is not of the extended type, then create one of the extended type (passing in the di guy state rep into the copy constructor) before setting in the base class. More...
 
bool needsVrfDataUpdate () const
 Returns true if the vrf object data has been modified. More...
 
void clearVrfDataNeedsUpdate ()
 
bool hasVrfObjectDataMessage () const
 Returns true if at least on vrf object data message has been processed by this entity. More...
 
void setHasVrfObjectDataMessage (bool)
 Sets whether or not has an object data message. More...
 
virtual DtExtDiGuyStateRepositoryextDiGuyStateRepository ()
 
virtual const
DtExtDiGuyStateRepository
extDiGuyStateRepository () const
 
virtual void createDiGuyStateRep ()
 Overrides the one in base, creates an extended DI-Guy object state repository instead. More...
 
virtual bool setupFromVrfObjectData (const DtIfVrfObjectData &data)
 Override to set myHasVrfObjectDataMessage to true. More...
 
virtual void setSendVrfObjectDataRecord (bool shouldSend)
 Whether a separate VrfObjectData message should be sent to convey additional VRF object information. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual const DtVector32 & boundingVolume () const
 
virtual void setBoundingVolumeOffset (const DtVector32 &)
 
virtual const DtVector32 & boundingVolumeOffset () const
 

Static Public Member Functions

static DtExtEntityStateRepositorycreate ()
 Creator method. More...
 
- Static Public Member Functions inherited from DtExtEntityBaseStateRepository
static
DtExtEntityBaseStateRepository
create ()
 
- Static Public Member Functions inherited from DtVrfExtensions
static void setExpectedVrfMessageVersion (DtU32 version)
 The expected VRF message version of this application. More...
 
static DtU32 expectedVrfMessageVersion ()
 

Protected Member Functions

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

Protected Attributes

DtRwPropertiesmyStateProperties
 
DtRwPropertiesmyParameterProperties
 
bool myOwnsProperties
 
bool myIsInitialized
 
std::list< PropertyDecoderInfomyAdditionalDecoders
 
std::list< PropertyEncoderInfomyAdditionalEncoders
 
std::vector< charmyPropertyBuffer
 
DtClock myClock
 
DtTime myLastEncodeTime
 
DtTime myLastDecodeTime
 
bool mySensorsKilled
 
bool myReceivedVrfObjectDataVersion
 
bool myReceivedVrfPropertyVersion
 
int myPropertyVersion
 
DtString myUUIDString
 
std::map< DtString, DtStringmyExtendedDataCache
 
DtRangeItems myRangeItemsCache
 
DtNoArgumentCallbackList myPropertyUpdatedCallbacks
 
- Protected Attributes inherited from DtExtEntityBaseStateRepository
DtExtEntityBaseStateRepositorymyLastCopy
 
bool myVrfObjectDataUpdated
 
bool myHasVrfObjectDataMessage
 If true, a vrf object data message has been seen for this object. By default, this is false. More...
 
bool mySendVrfObjectDataRec
 
- Protected Attributes inherited from DtVrfExtensions
DtString myName
 
DtIfVrfObjectDatamyVrfObjectDataMessage
 

Additional Inherited Members

- Static Protected Attributes inherited from DtVrfExtensions
static DtU32 theExpectedVrfMessageVersion
 

Detailed Description

DtExtEntityStateRepository class extends the DtExtEntityBaseStateRepository to be able to handle extended attributes.

Member Typedef Documentation

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

Constructor & Destructor Documentation

DtExtEntityStateRepository::DtExtEntityStateRepository ( )

Default CTOR.

DtExtEntityStateRepository::DtExtEntityStateRepository ( const DtExtEntityStateRepository orig)

Copy CTOR.

virtual DtExtEntityStateRepository::~DtExtEntityStateRepository ( )
virtual

Virtual DTOR.

Member Function Documentation

static DtExtEntityStateRepository* DtExtEntityStateRepository::create ( )
static

Creator method.

Caller responsible for deletion.

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

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

This can be more efficient if you are maintaining the properties lists elsewhere and want updates to be decoded directly into those lists. Does not take ownership of these properties. They must be deleted elsewhere.

virtual void DtExtEntityStateRepository::initialize ( const DtRwProperties stateProps,
const DtRwProperties paramProps 
)
virtual

Initializes the state rep by making a copy of the given state properties and parameter properties that have have already been initialized.

Maintains ownership of the new properties and will delete them on destruction.

virtual void DtExtEntityStateRepository::initialize ( )
virtual

Initializes the state rep without any state or parameter properties.

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

virtual bool DtExtEntityStateRepository::isInitialized ( ) const
virtual

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

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

Assignment operator.

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

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

Reimplemented from makVrfVrlinkExtToolkit::DtStateRepositoryWithExtendedAttributes< DtExtEntityBaseStateRepository >.

Reimplemented in MyEntityStateRep, and MyEntityStateRep.

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

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

virtual const DtRwProperties& DtExtEntityStateRepository::stateProperties ( ) const
inlinevirtual
virtual const DtRwProperties& DtExtEntityStateRepository::parameterProperties ( ) const
inlinevirtual
virtual void DtExtEntityStateRepository::setDiGuyAction ( const DtString val,
bool  paused,
double  speed = 0.0,
bool  usePositioning = false,
const DtVector offset = DtVector(0, 0, 0) 
)
virtual

DI-Guy extension. Set action with offset.

virtual void DtExtEntityStateRepository::setBodyWeight ( double  )
virtual

DI-Guy extension. Get/set body weight.

Reimplemented from DtExtEntityBaseStateRepository.

virtual double DtExtEntityStateRepository::bodyWeight ( ) const
virtual

Reimplemented from DtExtEntityBaseStateRepository.

virtual void DtExtEntityStateRepository::setUuidString ( const DtString uuidStr)
virtual
virtual DtString DtExtEntityStateRepository::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 DtExtEntityBaseStateRepository.

virtual bool DtExtEntityStateRepository::sensorsKilled ( ) const
virtual

Functions for accessing the sensors killed state.

virtual void DtExtEntityStateRepository::setSensorsKilled ( bool  killed)
virtual
void DtExtEntityStateRepository::mapPropertiesToRecordTypes ( const DtRwProperties properties,
std::map< unsigned, DtString > &  recTypesToAttrNames 
)

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

virtual bool DtExtEntityStateRepository::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 DtExtEntityStateRepository::updateAttributesFromProperties ( )
virtual

Updates extended attributes from our properties.

Used to update attributes before publishing an object update.

virtual void DtExtEntityStateRepository::addPropertyDecoder ( const DtString propName,
PropertyDecoder  decoder,
void *  usr,
unsigned  disRecordType = 0 
)
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. If disRecordType, properties with the g specified record type will use this decoder.

virtual void DtExtEntityStateRepository::addPropertyEncoder ( const DtString propName,
PropertyEncoder  encoder,
void *  usr,
unsigned  disRecordType = 0 
)
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. If disRecordType, the property will be encoded with the specified record type.

virtual void DtExtEntityStateRepository::removePropertyEncodersAndDecoders ( )
virtual

Removes all additional property encoders and decoders.

virtual bool DtExtEntityStateRepository::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 DtExtEntityStateRepository::giveOwernshipOfProperties ( )
virtual

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

virtual DtTime DtExtEntityStateRepository::lastPropertyEncodeTime ( ) const
inlinevirtual

Last time properties were encoded.

virtual DtTime DtExtEntityStateRepository::lastPropertyDecodeTime ( ) const
inlinevirtual

Last time properties were decoded.

virtual void DtExtEntityStateRepository::addPropertyUpdatedCallback ( DtNoArgumentCallbackList::DtCallbackFunctionType  fcn,
void *  usrData 
)
virtual

Callbacks invoked just after state and parameter properties have been updated when the parameter or state properties have been updated.

virtual void DtExtEntityStateRepository::removePropertyUpdatedCallback ( DtNoArgumentCallbackList::DtCallbackFunctionType  fcn,
void *  usrData 
)
virtual
virtual void DtExtEntityStateRepository::initializeVrfObjectDataProperties ( )
protectedvirtual

Initializes the state rep to handle VRF object data properties.

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

Encode a particular property if an update is needed.

Member Data Documentation

DtRwProperties* DtExtEntityStateRepository::myStateProperties
protected
DtRwProperties* DtExtEntityStateRepository::myParameterProperties
protected
bool DtExtEntityStateRepository::myOwnsProperties
protected
bool DtExtEntityStateRepository::myIsInitialized
protected
std::list<PropertyDecoderInfo> DtExtEntityStateRepository::myAdditionalDecoders
protected
std::list<PropertyEncoderInfo> DtExtEntityStateRepository::myAdditionalEncoders
protected
std::vector<char> DtExtEntityStateRepository::myPropertyBuffer
protected
DtClock DtExtEntityStateRepository::myClock
protected
DtTime DtExtEntityStateRepository::myLastEncodeTime
protected
DtTime DtExtEntityStateRepository::myLastDecodeTime
protected
bool DtExtEntityStateRepository::mySensorsKilled
protected
bool DtExtEntityStateRepository::myReceivedVrfObjectDataVersion
protected
bool DtExtEntityStateRepository::myReceivedVrfPropertyVersion
protected
int DtExtEntityStateRepository::myPropertyVersion
mutableprotected
DtString DtExtEntityStateRepository::myUUIDString
mutableprotected
std::map<DtString,DtString> DtExtEntityStateRepository::myExtendedDataCache
mutableprotected
DtRangeItems DtExtEntityStateRepository::myRangeItemsCache
mutableprotected
DtNoArgumentCallbackList DtExtEntityStateRepository::myPropertyUpdatedCallbacks
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)