VR-Vantage 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
MyEntityStateRep Class Reference

Because this example adds a concept that did not already exist in VR-Link's DtEntityStateRepository class, we create this subclass of DtEntityStateRepository that adds the concept of mass. More...

Inheritance diagram for MyEntityStateRep:
Inheritance graph
[legend]

Public Member Functions

 MyEntityStateRep ()
 CTOR.
virtual ~MyEntityStateRep ()
 DTOR.
virtual void setMass (float mass)
 Set the mass.
virtual float mass () const
 Return the mass.
virtual void printData () const
 Virtual function override: print the state rep's data.
virtual DtStateRepositoryclone (bool copy=false) const
 Copy shallow (false) or deep (true).
- Public Member Functions inherited from DtExtEntityStateRepository
 DtExtEntityStateRepository ()
 Default CTOR.
 DtExtEntityStateRepository (const DtExtEntityStateRepository &orig)
 Copy CTOR.
virtual ~DtExtEntityStateRepository ()
 Virtual DTOR.
virtual bool isInitialized () const
 Returns true if one of the initialize() functions has been called.
DtExtEntityStateRepositoryoperator= (const DtExtEntityStateRepository &orig)
 Assignment operator.
virtual int compare (const DtExtEntityStateRepository *rhs)
 Compares us against the supplied state repository and returns what's changed.
virtual const DtRwProperties & stateProperties () const
virtual const DtRwProperties & parameterProperties () const
virtual void setDiGuyAction (const DtString &val, bool paused, double speed=0.0, bool usePositioning=false, const DtVector &offset=DtVector(0, 0, 0), double transitionSpeed=1.0)
 DI-Guy extension. Set action with offset.
virtual void setBodyWeight (double)
 DI-Guy extension. Get/set body weight.
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.
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, unsigned disRecordType=0)
 Adds an additional property and a function that to decode it.
virtual void addPropertyEncoder (const DtString &propName, PropertyEncoder encoder, void *usr, unsigned disRecordType=0)
 Adds an additional property and a function that to encode it.
virtual void removePropertyEncodersAndDecoders ()
 Removes all additional property encoders and decoders.
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 (DtRwProperties *stateProps, DtRwProperties *paramProps)
 Initializes the state rep with state properties and parameter properties that have have already been initialized.
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.
virtual void initialize ()
 Initializes the state rep without any state or parameter properties.
virtual bool sensorsKilled () const
 Functions for accessing the sensors killed state.
virtual void setSensorsKilled (bool killed)
 Functions for accessing the sensors killed state.
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.
virtual void removePropertyUpdatedCallback (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.
- Public Member Functions inherited from DtExtEntityBaseStateRepository
 DtExtEntityBaseStateRepository ()
 default constructor
virtual ~DtExtEntityBaseStateRepository ()
 destructor
 DtExtEntityBaseStateRepository (const DtExtEntityBaseStateRepository &orig)
 copy constructor
DtExtEntityBaseStateRepositoryoperator= (const DtExtEntityBaseStateRepository &orig)
 assignment operator
virtual int compare (const DtExtEntityBaseStateRepository *rhs)
 Compares us against the supplied state repository and returns what's changed.
virtual int compareToMostRecent ()
 Returns what has changed since the last time we called compare.
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.
virtual int compareArtParts (const DtArticulatedPart *source, const DtArticulatedPart *target)
 Compares each value that is valid, and, if any have changed, returns DtChanged_Other.
virtual bool locationsDifferent (bool updateIfDifferent)
 Returns true if our stashed location is different than our current location.
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.
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)
 Override to set myHasVrfObjectDataMessage to true.
virtual void setSendVrfObjectDataRecord (bool shouldSend)
 Whether a separate VrfObjectData message should be sent to convey additional VRF object information.
virtual bool shouldSendVrfObjectDataRecord () const
 Whether a separate VrfObjectData message should be sent to convey additional VRF object information.
- 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
 Gets/sets extended data.
virtual void setExtendedData (const DtString &key, const DtString &value)
 Gets/sets extended data.
virtual DtString extendedData (const DtString &) const
 Gets/sets extended data.
virtual void setBoundingVolume (const DtVector32 &)
 Sets/gets bounding volume and bounding volume offset of an entity.
virtual const DtVector32 & boundingVolume () const
 Sets/gets bounding volume and bounding volume offset of an entity.
virtual void setBoundingVolumeOffset (const DtVector32 &)
 Sets/gets bounding volume and bounding volume offset of an entity.
virtual const DtVector32 & boundingVolumeOffset () const
 Sets/gets bounding volume and bounding volume offset of an entity.

Protected Attributes

float myMass
- Protected Attributes inherited from DtExtEntityStateRepository
DtRwProperties * myStateProperties
DtRwProperties * myParameterProperties
bool myOwnsProperties
bool myIsInitialized
std::list< PropertyDecoderInfomyAdditionalDecoders
std::list< PropertyEncoderInfomyAdditionalEncoders
std::vector< char > myPropertyBuffer
DtClock myClock
DtTime myLastEncodeTime
DtTime myLastDecodeTime
bool mySensorsKilled
bool myReceivedVrfObjectDataVersion
bool myReceivedVrfPropertyVersion
int myPropertyVersion
DtString myUUIDString
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.
bool mySendVrfObjectDataRec
- Protected Attributes inherited from DtVrfExtensions
DtString myName
DtIfVrfObjectDatamyVrfObjectDataMessage

Additional Inherited Members

- Public Types inherited from DtExtEntityStateRepository
typedef void(* PropertyDecoder )(const char *buffer, unsigned size, int version, void *usr)
typedef void(* PropertyEncoder )(std::vector< char > &buffer, void *usr)
- Static Public Member Functions inherited from DtExtEntityStateRepository
static DtExtEntityStateRepositorycreate ()
 Creator method.
- Protected Member Functions inherited from DtExtEntityStateRepository
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.

Detailed Description

Because this example adds a concept that did not already exist in VR-Link's DtEntityStateRepository class, we create this subclass of DtEntityStateRepository that adds the concept of mass.

This class is identical to the State Rep in the addAttr example.

Constructor & Destructor Documentation

MyEntityStateRep::MyEntityStateRep ( )

CTOR.

virtual MyEntityStateRep::~MyEntityStateRep ( )
virtual

DTOR.

Member Function Documentation

virtual void MyEntityStateRep::setMass ( float  mass)
virtual

Set the mass.

virtual float MyEntityStateRep::mass ( ) const
virtual

Return the mass.

virtual void MyEntityStateRep::printData ( ) const
virtual

Virtual function override: print the state rep's data.

Reimplemented from makVrfVrlinkExtToolkit::DtStateRepositoryWithExtendedAttributes< DtExtEntityBaseStateRepository >.

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

Copy shallow (false) or deep (true).

Reimplemented from DtExtEntityStateRepository.

Member Data Documentation

float MyEntityStateRep::myMass
protected

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


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)