MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
MAKLogger::DtLgrDisMessageState Class Reference

Responsible for maintaining a DIS simulation state. More...

+ Inheritance diagram for MAKLogger::DtLgrDisMessageState:
+ Collaboration diagram for MAKLogger::DtLgrDisMessageState:

Classes

struct  NetInitialStateUpdateHeader
 

Public Types

typedef std::set< DtPduKind > DtPduKindSet
 
- Public Types inherited from MAKLogger::DtMessageState
enum  CheckpointProcessing { IgnoreCheckpoints, ProcessAllCheckpoints, ProcessFirstCheckpoint }
 
enum  InteractionProcessing { IgnoreInteractions, IncludeInteractions, DrainInteractions }
 
typedef std::list< DtPacket * > DtPacketList
 Type for the queue of interactions. More...
 

Public Member Functions

 DT_VIRTUAL_CTR_DEFAULTS (DtLgrDisMessageState,(const DtPduKindSet &statePduKinds, const DtLgrDisSimulationManager *simMgr),(const DtPduKindSet &statePduKinds, const DtLgrDisSimulationManager *simMgr=0)) virtual ~DtLgrDisMessageState()
 
virtual void modifyMessages (DtMessageBuffer &messages) const
 Modifies the messages. More...
 
virtual void modifyMessage (DtPacket &packet) const
 Modifies the packet, currently no-op. More...
 
virtual void decodeInitialState (const DtPacket &packet, DtMessageBuffer &buffer)
 Decode an initial state packet into a message buffer. More...
 
virtual void decodeCheckpoint (const DtPacket &packet, DtMessageBuffer &messageBuffer, bool includeInteractions)
 Decode a checkpoint packet into the buffer. More...
 
virtual void decodeLinkedCheckpoint (const DtPacket &packet, DtMessageBuffer &messageBuffer, bool includeInteractions)
 Decode a linked checkpoint packet into a message buffer. More...
 
virtual bool isUpdateMessage (const DtPacket &packet) const
 Check to see if the state thinks this is an udpate. More...
 
virtual bool isUpdateMessage (DtPduKind pduKind) const
 Check to see if the state thinks this is an udpate. More...
 
virtual bool isRemovalMessage (const DtPacket &packet) const
 Check to see if the state thinks this is an remove entity. More...
 
virtual bool isInteractionMessage (const DtPacket &packet) const
 Check to see if the state thinks this is an interaction. More...
 
virtual bool isInteractionMessage (DtPduKind pduKind) const
 Check to see if the state thinks this is an interaction. More...
 
virtual void createUpdate (const DtStateObject &object, const DtAbsoluteTime *time, std::list< DtPacket * > &packetlist) const
 Create an update encoded into a packet. More...
 
virtual DtPacketcreateRemoval (const DtStateObject &object, const DtAbsoluteTime &time) const
 Create a removal encoded into a packet. More...
 
virtual void setInputVersion (int disVersion)
 
virtual void setOutputVersion (int disVersion)
 
- Public Member Functions inherited from MAKLogger::DtMessageState
virtual ~DtMessageState ()
 DTOR Will destroy all state objects. More...
 
virtual const DtLgrSimManagersimMgr () const
 Return the sim manager. More...
 
virtual void startDiff ()
 Start difference mode, creates snapshot of existing state to be used with. More...
 
virtual void generateDiff (DtMessageBuffer &stateBuffer, const DtAbsoluteTime &time, bool addUpdates, InteractionProcessing processInteractions)
 Next update will generate only diff messages which are necessary to go from the backed up state to the current state. More...
 
virtual void endDiff ()
 Destroys the snapshot. More...
 
virtual bool isDiffInProgress () const
 Indicates if a diff is in progress. More...
 
virtual void updateState (DtMessageBuffer &stateBuffer)
 Update existing objects and add new objects. More...
 
virtual void updateState (DtPacket *packet)
 Update existing objects and add new objects. More...
 
virtual void postUpdate ()
 Call post update after finished. More...
 
virtual void setState (DtMessageBuffer &completeStateBuffer, const DtAbsoluteTime &time, DtMessageBuffer *diffBuffer=0)
 Set the state with the internal messages. More...
 
virtual void addState (DtMessageBuffer &stateBuffer, const DtAbsoluteTime &time)
 Add objects from buffer to the state. More...
 
virtual void clearState (DtMessageBuffer &emptyBuffer, const DtAbsoluteTime &time)
 Clear the state and returns the messages necessary to send to clear the state. More...
 
virtual void getState (DtMessageBuffer &emptyBuffer, const DtAbsoluteTime *time, bool modifyMessages=true)
 Return a message buffer with state messages of all cached objects and interactions. More...
 
virtual void getStateObjects (DtMessageBuffer &buffer, const DtAbsoluteTime *time, bool modifyMessages=true)
 Create update packets at the given time for each object in the state and add them to the buffer. More...
 
virtual void getStateInteractions (DtMessageBuffer &buffer, const DtAbsoluteTime *time, bool modifyMessages=true)
 Get any cached interactions into the given buffer. More...
 
virtual void activate ()
 Activate the Message state. More...
 
virtual void deactivate ()
 Deactivate the message state. More...
 
virtual const std::list
< DtStateObject * > & 
stateObjectList () const
 Gets a list of state objects. More...
 
virtual void clearState ()
 Clear the state without creating the removals. More...
 
virtual CheckpointProcessing processCheckpoints ()
 Check to see if checkpoints affect the state. More...
 
virtual void setProcessCheckpoints (CheckpointProcessing value)
 Set whether checkpoints affect the state. More...
 
virtual void setInteractionsCollectedForCheckpoints (bool enable)
 Set whether to collect interactions used for checkpoints. More...
 
virtual bool interactionsCollectedForCheckpoints () const
 Get whether to collect interactions used for checkpoints. More...
 
virtual void setInteractionsCollectedFromCheckpoints (bool enable)
 Set whether to collect interactions from checkpoints) More...
 
virtual bool interactionsCollectedFromCheckpoints () const
 Get whether to collect interactions from checkpoints. More...
 
virtual bool isInitialStateMessage (const DtPacket &packet) const
 Check to see if the State considers this packet an initial state. More...
 
virtual bool isCheckpointMessage (const DtPacket &packet) const
 Check to see if the State considers this packet a checkpoint. More...
 
virtual void createUpdate (const DtStateObject &object, const DtAbsoluteTime *time, DtPacketList &packetlist) const =0
 Create update packet(s) for the object at the given time if provided. More...
 
virtual DtStateObjectfindObject (DtU64 uniqueId)
 Find an object. More...
 
virtual const DtStateObjectfindObject (DtU64 uniqueId) const
 Find an object. More...
 
virtual DtStateObjectfindObjectByName (const DtString &name)
 Find an object with the given name. More...
 
virtual const DtStateObjectfindObjectByName (const DtString &name) const
 Find an object with the given name. More...
 
virtual void setLinkCheckpoints (bool enableLinking)
 Set/Get link checkpoint flag. More...
 
virtual bool linkCheckpointsEnabled () const
 Set/Get link checkpoint flag. More...
 
virtual void setInputInfo (const DtMessageIOInfo *info)
 Sets the Input Io Info. More...
 
virtual void setOutputInfo (const DtMessageIOInfo *info)
 Sets the Input Io Info. More...
 
virtual DtPacketgenerateInitialState (const DtAbsoluteTime &timestamp, const DtAbsoluteTime &currentTime, bool isTransition)
 Generates an initial state packet containing the current state. More...
 
virtual DtPacketgenerateCheckpoint (const DtAbsoluteTime &timestamp, bool includeInteractions)
 Generates a checkpoint packet containing the current state including received interactions if specified. More...
 
virtual DtObserveEvent
< DtMessageState > * 
inputChangedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtMessageState > * 
outputChangedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtMessageState > * 
stateModifiedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtMessageState > * 
stateActivatedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtMessageState > * 
stateDeactivatedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtMessageState > * 
endDiffEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtStateObject > * 
objectAddedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtStateObject > * 
objectToBeRemovedEvent ()
 Event accessors. More...
 
virtual DtObserveEvent
< DtStateObject > * 
objectUpdatedEvent ()
 Event accessors. More...
 

Protected Member Functions

 DtLgrDisMessageState (const DtLgrDisMessageState &)
 CopyCTOR operator not implemented. More...
 
DtLgrDisMessageStateoperator= (const DtLgrDisMessageState &)
 Assignment operator not implemented. More...
 
virtual int decodeState (const char *data, size_t bufferSize, const DtAbsoluteTime &time, DtMessageBuffer &messageBuffer, bool includeInteractions, bool useStateHeader)
 Decode state data into messages inserted into provided buffer. More...
 
virtual void decodeCheckpoint (const char *checkpointBuffer, size_t bufferSize, const DtAbsoluteTime &time, DtMessageBuffer &messageBuffer, bool includeInteractions)
 Decode packets from a checkpoint buffer. More...
 
virtual DtPacketcreateInitialStatePacket (const DtMessageBuffer &initialStateBuffer, const DtAbsoluteTime &timestamp, double offsetTime)
 Return an initial state packet with the given timestamp filled with the state data from the given buffer A negative offset indicates the state data is transitional and when decoding state packet times from the past should not be adjusted. More...
 
virtual DtPacketcreateCheckpointPacket (const DtMessageBuffer &checkpointBuffer, const DtAbsoluteTime &timestamp)
 Return a checkpoint packet filled with the state data from the given buffer. More...
 
virtual void fillWithStateData (const DtMessageBuffer &stateBuffer, char *data, bool includeUpdateHeaders)
 Fill the given data buffer with the contents of the state buffer. More...
 
virtual void activateState ()
 Activate the protocol specific state. More...
 
virtual void deactivateState ()
 Deactivate the protocol specific state. More...
 
- Protected Member Functions inherited from MAKLogger::DtMessageState
 DtMessageState (const DtLgrSimManager *simMgr=0)
 Protected CTOR since class is abstract. More...
 
 DtMessageState (const DtMessageState &)
 CopyCTOR not implemented. More...
 
DtMessageStateoperator= (const DtMessageState &)
 Assignment operator not implemented. More...
 
virtual bool updateStateObjects (const DtPacket &packet)
 Used to update state objects using the packet. More...
 
virtual DtStateObjectcreateStateObject (const DtPacket &packet)
 Create the state object based upon the packet. More...
 
virtual DtStateObjectupdateStateObject (const DtPacket &packet)
 Update the state object based upon the packet. More...
 
virtual DtStateObjectfindStateObject (const DtPacket &packet)
 Find a state object for a packet. More...
 
virtual void removeStateObject (const DtStateObject *object)
 Remove the state object. More...
 
virtual void createUpdate (const DtStateObject &object, const DtAbsoluteTime *time, DtMessageBuffer &buffer) const
 Create update packet(s) for the object at the given time if provided and add them to buffer. More...
 
virtual bool removeStateObject (const DtPacket &packet)
 Remove the state object based upon the packet. More...
 
virtual void clearObjectList (DtStateObjectList &objectList, DtMessageBuffer *emptyStateBuffer, DtAbsoluteTime time)
 Clear the object list. More...
 
virtual void clearObjectList (DtStateObjectList &objectList)
 Clear the object list. More...
 
virtual void clearInteractionList (DtPacketList &interactionList)
 Clear the interaction list. More...
 

Protected Attributes

DtPduKindSet myStatePduKinds
 
int myInputVersion
 
int myOutputVersion
 
- Protected Attributes inherited from MAKLogger::DtMessageState
DtStateObjectList myObjects
 List of state objects. More...
 
DtPacketList myInteractions
 List of interactions received since last flush. More...
 
DtStateObjectMap myObjectLookupMap
 Map to lookup state objects. More...
 
DtStateObjectNameMap myObjectLookupNameMap
 Map to lookup state objects. More...
 
DtStateObjectList mySnapshotOfObjects
 List of objects used when diffing two different states. More...
 
const DtLgrSimManagermySimMgr
 The simulation manager. More...
 
CheckpointProcessing myCheckpointProcessing
 
bool myStateChanged
 
bool myCheckpointInteractions
 
bool myLinkCheckpoints
 
bool myUseDiffTimeForStateObjects
 
bool myCollectInteractionsFromCheckpoint
 
bool myDiffInProgress
 
DtObserveEvent< DtMessageStatemyInputChangedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtMessageStatemyOutputChangedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtMessageStatemyStateModifiedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtMessageStatemyStateActivatedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtMessageStatemyStateDeactivetedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtMessageStatemyEndDiffEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtStateObjectmyObjectAddedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtStateObjectmyObjectToBeRemovedEvent
 Events called on certain actions of the messageState. More...
 
DtObserveEvent< DtStateObjectmyObjectUpdatedEvent
 Events called on certain actions of the messageState. More...
 

Additional Inherited Members

- Protected Types inherited from MAKLogger::DtMessageState
typedef std::list
< DtStateObject * > 
DtStateObjectList
 Type for the list of objects. More...
 
typedef std::map< DtU64,
DtStateObject * > 
DtStateObjectMap
 Type for lookup objects by unique id. More...
 
typedef std::map< DtString,
DtStateObject * > 
DtStateObjectNameMap
 Type for lookup objects by name. More...
 

Detailed Description

Responsible for maintaining a DIS simulation state.

Member Typedef Documentation

typedef std::set<DtPduKind> MAKLogger::DtLgrDisMessageState::DtPduKindSet

Constructor & Destructor Documentation

MAKLogger::DtLgrDisMessageState::DtLgrDisMessageState ( const DtLgrDisMessageState )
protected

CopyCTOR operator not implemented.

Member Function Documentation

virtual void MAKLogger::DtLgrDisMessageState::activateState ( )
protectedvirtual

Activate the protocol specific state.

Implements MAKLogger::DtMessageState.

virtual DtPacket* MAKLogger::DtLgrDisMessageState::createCheckpointPacket ( const DtMessageBuffer checkpointBuffer,
const DtAbsoluteTime timestamp 
)
protectedvirtual

Return a checkpoint packet filled with the state data from the given buffer.

Implements MAKLogger::DtMessageState.

virtual DtPacket* MAKLogger::DtLgrDisMessageState::createInitialStatePacket ( const DtMessageBuffer initialStateBuffer,
const DtAbsoluteTime timestamp,
double  offsetTime 
)
protectedvirtual

Return an initial state packet with the given timestamp filled with the state data from the given buffer A negative offset indicates the state data is transitional and when decoding state packet times from the past should not be adjusted.

The actual offset value is not used other than informational.

Implements MAKLogger::DtMessageState.

virtual DtPacket* MAKLogger::DtLgrDisMessageState::createRemoval ( const DtStateObject object,
const DtAbsoluteTime time 
) const
virtual

Create a removal encoded into a packet.

Implements MAKLogger::DtMessageState.

virtual void MAKLogger::DtLgrDisMessageState::createUpdate ( const DtStateObject object,
const DtAbsoluteTime time,
std::list< DtPacket * > &  packetlist 
) const
virtual

Create an update encoded into a packet.

virtual void MAKLogger::DtLgrDisMessageState::deactivateState ( )
protectedvirtual

Deactivate the protocol specific state.

Implements MAKLogger::DtMessageState.

virtual void MAKLogger::DtLgrDisMessageState::decodeCheckpoint ( const DtPacket packet,
DtMessageBuffer messageBuffer,
bool  includeInteractions 
)
virtual

Decode a checkpoint packet into the buffer.

Implements MAKLogger::DtMessageState.

virtual void MAKLogger::DtLgrDisMessageState::decodeCheckpoint ( const char *  checkpointBuffer,
size_t  bufferSize,
const DtAbsoluteTime time,
DtMessageBuffer messageBuffer,
bool  includeInteractions 
)
protectedvirtual

Decode packets from a checkpoint buffer.

For DIS, each generated packet is assigned the checkpoint packet time as each encoded state data is just a PDU that only has the DIS timestamp and not the last update timestamp

virtual void MAKLogger::DtLgrDisMessageState::decodeInitialState ( const DtPacket packet,
DtMessageBuffer buffer 
)
virtual

Decode an initial state packet into a message buffer.

Implements MAKLogger::DtMessageState.

virtual void MAKLogger::DtLgrDisMessageState::decodeLinkedCheckpoint ( const DtPacket packet,
DtMessageBuffer messageBuffer,
bool  includeInteractions 
)
virtual

Decode a linked checkpoint packet into a message buffer.

Implements MAKLogger::DtMessageState.

virtual int MAKLogger::DtLgrDisMessageState::decodeState ( const char *  data,
size_t  bufferSize,
const DtAbsoluteTime time,
DtMessageBuffer messageBuffer,
bool  includeInteractions,
bool  useStateHeader 
)
protectedvirtual

Decode state data into messages inserted into provided buffer.

As directed, include interaction data and use state headers to assign message timestamps from last update time of stored state

MAKLogger::DtLgrDisMessageState::DT_VIRTUAL_CTR_DEFAULTS ( DtLgrDisMessageState  ,
(const DtPduKindSet &statePduKinds, const DtLgrDisSimulationManager *simMgr ,
(const DtPduKindSet &statePduKinds, const DtLgrDisSimulationManager *simMgr=0)   
)
virtual void MAKLogger::DtLgrDisMessageState::fillWithStateData ( const DtMessageBuffer stateBuffer,
char *  data,
bool  includeUpdateHeaders 
)
protectedvirtual

Fill the given data buffer with the contents of the state buffer.

virtual bool MAKLogger::DtLgrDisMessageState::isInteractionMessage ( const DtPacket packet) const
virtual

Check to see if the state thinks this is an interaction.

Implements MAKLogger::DtMessageState.

virtual bool MAKLogger::DtLgrDisMessageState::isInteractionMessage ( DtPduKind  pduKind) const
virtual

Check to see if the state thinks this is an interaction.

virtual bool MAKLogger::DtLgrDisMessageState::isRemovalMessage ( const DtPacket packet) const
virtual

Check to see if the state thinks this is an remove entity.

Implements MAKLogger::DtMessageState.

virtual bool MAKLogger::DtLgrDisMessageState::isUpdateMessage ( const DtPacket packet) const
virtual

Check to see if the state thinks this is an udpate.

Implements MAKLogger::DtMessageState.

virtual bool MAKLogger::DtLgrDisMessageState::isUpdateMessage ( DtPduKind  pduKind) const
virtual

Check to see if the state thinks this is an udpate.

virtual void MAKLogger::DtLgrDisMessageState::modifyMessage ( DtPacket packet) const
virtual

Modifies the packet, currently no-op.

Implements MAKLogger::DtMessageState.

virtual void MAKLogger::DtLgrDisMessageState::modifyMessages ( DtMessageBuffer messages) const
virtual

Modifies the messages.

currently no-op.

Parameters
Output

Reimplemented from MAKLogger::DtMessageState.

DtLgrDisMessageState& MAKLogger::DtLgrDisMessageState::operator= ( const DtLgrDisMessageState )
protected

Assignment operator not implemented.

virtual void MAKLogger::DtLgrDisMessageState::setInputVersion ( int  disVersion)
virtual
virtual void MAKLogger::DtLgrDisMessageState::setOutputVersion ( int  disVersion)
virtual

Member Data Documentation

int MAKLogger::DtLgrDisMessageState::myInputVersion
protected
int MAKLogger::DtLgrDisMessageState::myOutputVersion
protected
DtPduKindSet MAKLogger::DtLgrDisMessageState::myStatePduKinds
protected

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

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)