![]() |
MAK Data Logger API Documentation for DIS
|
The Abstract message state maintained by the logger. More...
Inheritance diagram for MAKLogger::DtMessageState:
Collaboration diagram for MAKLogger::DtMessageState:Classes | |
| struct | NetCheckpointHeader |
Public Types | |
| enum | CheckpointProcessing { IgnoreCheckpoints, ProcessAllCheckpoints, ProcessFirstCheckpoint } |
| enum | InteractionProcessing { IgnoreInteractions, IncludeInteractions, DrainInteractions } |
| typedef std::list< DtPacket * > | DtPacketList |
| Type for the queue of interactions. | |
Public Member Functions | |
| virtual | ~DtMessageState () |
| DTOR Will destroy all state objects. | |
| virtual void | startDiff () |
| Start difference mode, creates snapshot of existing state to be used with. | |
| virtual void | generateDiff (DtMessageBuffer &stateBuffer, const DtAbsoluteTime &time, InteractionProcessing processInteractions) |
| Next update will generate only diff messages which are necessary to go from the backed up state to the current state. | |
| virtual void | endDiff () |
| Destroys the snapshot. | |
| virtual void | updateState (DtMessageBuffer &stateBuffer) |
| Update existing objects and add new objects. | |
| virtual void | updateState (DtPacket *packet) |
| Update existing objects and add new objects. | |
| virtual void | postUpdate () |
| Call post update after finished. | |
| virtual void | setState (DtMessageBuffer &completeStateBuffer, const DtAbsoluteTime &time, DtMessageBuffer *diffBuffer=0) |
| Set the state with the internal messages. | |
| virtual void | clearState (DtMessageBuffer &emptyBuffer, const DtAbsoluteTime &time) |
| Clear the state and returns the messages necessary to send to clear the state. | |
| virtual void | getState (DtMessageBuffer &emptyBuffer, const DtAbsoluteTime &time, bool modifyMessages=true) |
| Return a message buffer with state messages of all cached objects and interactions. | |
| 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. | |
| virtual void | getStateInteractions (DtMessageBuffer &buffer, const DtAbsoluteTime &time, bool modifyMessages=true) |
| Get any cached interactions into the given buffer. | |
| virtual void | activate () |
| Activate the Message state. | |
| virtual void | deactivate () |
| Deactivate the message state. | |
| virtual const std::list < DtStateObject * > & | stateObjectList () const |
| Gets a list of state objects. | |
| virtual void | clearState () |
| Clear the state without creating the removals. | |
| virtual CheckpointProcessing | processCheckpoints () |
| Check to see if checkpoints affect the state. | |
| virtual void | setProcessCheckpoints (CheckpointProcessing value) |
| Set whether checkpoints affect the state. | |
| virtual void | setInteractionsCollectedForCheckpoints (bool enable) |
| Set whether to collect interactions used for checkpoints. | |
| virtual bool | interactionsCollectedForCheckpoints () const |
| Get whether to collect interactions used for checkpoints. | |
| virtual void | setInteractionsCollectedFromCheckpoints (bool enable) |
| Set whether to collect interactions from checkpoints) | |
| virtual bool | interactionsCollectedFromCheckpoints () const |
| Get whether to collect interactions from checkpoints. | |
| virtual void | modifyMessages (DtMessageBuffer &messages) const |
| Calls modifyMessage for each packet in the buffer. | |
| virtual void | modifyMessage (DtPacket &packet) const =0 |
| Modify a packet. | |
| virtual bool | isCheckpointMessage (const DtPacket &packet) const |
| Check to see if the State considers this packet a checkpoint. | |
| virtual bool | isUpdateMessage (const DtPacket &packet) const =0 |
| Check to see if the state thinks this is an object update. | |
| virtual bool | isRemovalMessage (const DtPacket &packet) const =0 |
| Check to see if the state thinks this is an object removal. | |
| virtual bool | isInteractionMessage (const DtPacket &packet) const =0 |
| Check to see if the state thinks this is an interaction. | |
| virtual void | createUpdate (const DtStateObject &object, const DtAbsoluteTime &time, DtPacketList &packetlist) const =0 |
| Create update packet(s) for the object at the given time. | |
| virtual DtPacket * | createRemoval (const DtStateObject &object, const DtAbsoluteTime &time) const =0 |
| Create an removal packet for the object at the given time. | |
| virtual DtStateObject * | findObject (DtU64 uniqueId) |
| Find an object. | |
| virtual const DtStateObject * | findObject (DtU64 uniqueId) const |
| Find an object. | |
| virtual DtStateObject * | findObjectByName (const DtString &name) |
| Find an object with the given name. | |
| virtual const DtStateObject * | findObjectByName (const DtString &name) const |
| Find an object with the given name. | |
| virtual void | setLinkCheckpoints (bool enableLinking) |
| Set/Get link checkpoint flag. | |
| virtual bool | linkCheckpointsEnabled () const |
| Set/Get link checkpoint flag. | |
Abstract message state interface. | |
| virtual void | setInputInfo (const DtMessageIOInfo *info) |
| Sets the Input Io Info. | |
| virtual void | setOutputInfo (const DtMessageIOInfo *info) |
| Sets the Input Io Info. | |
| virtual void | decodeCheckpoint (const DtPacket &packet, DtMessageBuffer &buffer, bool includeInteractions)=0 |
| Decode a checkpoint packet into a message buffer. | |
| virtual void | decodeLinkedCheckpoint (const DtPacket &packet, DtMessageBuffer &buffer, bool includeInteractions)=0 |
| Decode a linked checkpoint packet into a message buffer. | |
| virtual DtPacket * | generateCheckpoint (const DtAbsoluteTime ×tamp, bool includeInteractions)=0 |
| Generate a checkpoint packet from the current state. | |
| virtual DtObserveEvent < DtMessageState > * | inputChangedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtMessageState > * | outputChangedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtMessageState > * | stateModifiedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtMessageState > * | stateActivatedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtMessageState > * | stateDeactivatedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtMessageState > * | endDiffEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtStateObject > * | objectAddedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtStateObject > * | objectToBeRemovedEvent () |
| Event accessors. | |
| virtual DtObserveEvent < DtStateObject > * | objectUpdatedEvent () |
| Event accessors. | |
Protected Types | |
| typedef std::list < DtStateObject * > | DtStateObjectList |
| Type for the list of objects. | |
| typedef std::map< DtU64, DtStateObject * > | DtStateObjectMap |
| Type for lookup objects by unique id. | |
| typedef std::map< DtString, DtStateObject * > | DtStateObjectNameMap |
| Type for lookup objects by name. | |
Protected Member Functions | |
| DtMessageState (const DtLgrSimManager *simMgr=0) | |
| Protected CTOR since class is abstract. | |
| DtMessageState (const DtMessageState &) | |
| CopyCTOR not implemented. | |
| DtMessageState & | operator= (const DtMessageState &) |
| Assignment operator not implemented. | |
| virtual void | activateState ()=0 |
| Activate the protocol specific state. | |
| virtual void | deactivateState ()=0 |
| Deactivate the protocol specific state. | |
| virtual bool | updateStateObjects (const DtPacket &packet) |
| Used to update state objects using the packet. | |
| virtual DtStateObject * | createStateObject (const DtPacket &packet) |
| Create the state object based upon the packet. | |
| virtual DtStateObject * | updateStateObject (const DtPacket &packet) |
| Update the state object based upon the packet. | |
| virtual DtStateObject * | findStateObject (const DtPacket &packet) |
| Find a state object for a packet. | |
| virtual void | removeStateObject (const DtStateObject *object) |
| Remove the state object. | |
| virtual void | createUpdate (const DtStateObject &object, const DtAbsoluteTime &time, DtMessageBuffer &buffer) const |
| Create update packet(s) for the object at the given time and add them to buffer. | |
| virtual bool | removeStateObject (const DtPacket &packet) |
| Remove the state object based upon the packet. | |
Protected Attributes | |
| DtStateObjectList | myObjects |
| List of state objects. | |
| DtPacketList | myInteractions |
| List of interactions received since last flush. | |
| DtStateObjectMap | myObjectLookupMap |
| Map to lookup state objects. | |
| DtStateObjectNameMap | myObjectLookupNameMap |
| Map to lookup state objects. | |
| DtStateObjectList | mySnapshotOfObjects |
| List of objects used when diffing two different states. | |
| const DtLgrSimManager * | mySimMgr |
| The simulation manager. | |
| CheckpointProcessing | myCheckpointProcessing |
| bool | myStateChanged |
| bool | myCheckpointInteractions |
| bool | myLinkCheckpoints |
| bool | myCollectInteractionsFromCheckpoint |
| DtObserveEvent< DtMessageState > | myInputChangedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtMessageState > | myOutputChangedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtMessageState > | myStateModifiedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtMessageState > | myStateActivatedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtMessageState > | myStateDeactivetedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtMessageState > | myEndDiffEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtStateObject > | myObjectAddedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtStateObject > | myObjectToBeRemovedEvent |
| Events called on certain actions of the messageState. | |
| DtObserveEvent< DtStateObject > | myObjectUpdatedEvent |
| Events called on certain actions of the messageState. | |
The Abstract message state maintained by the logger.
The message state takes in messages from the input and maintains a state of all 'statefull objects' in the simulation.
| typedef std::list<DtPacket*> MAKLogger::DtMessageState::DtPacketList |
Type for the queue of interactions.
|
protected |
Type for the list of objects.
|
protected |
Type for lookup objects by unique id.
|
protected |
Type for lookup objects by name.
|
virtual |
DTOR Will destroy all state objects.
|
protected |
Protected CTOR since class is abstract.
|
protected |
CopyCTOR not implemented.
|
virtual |
Activate the Message state.
|
protectedpure virtual |
Activate the protocol specific state.
Implemented in MAKLogger::DtLgrDisMessageState.
|
virtual |
Clear the state and returns the messages necessary to send to clear the state.
Note message buffer passed in will be emptied before filled.
| Output | |
| emptyBuffer | Contains the modified messages to send to clear the state. |
|
virtual |
Clear the state without creating the removals.
|
pure virtual |
Create an removal packet for the object at the given time.
Implemented in MAKLogger::DtLgrDisMessageState.
|
protectedvirtual |
Create the state object based upon the packet.
| Valid | Pointer If object was created. |
| NULL | If object was not created. |
|
pure virtual |
Create update packet(s) for the object at the given time.
|
protectedvirtual |
Create update packet(s) for the object at the given time and add them to buffer.
|
virtual |
Deactivate the message state.
|
protectedpure virtual |
Deactivate the protocol specific state.
Implemented in MAKLogger::DtLgrDisMessageState.
|
pure virtual |
Decode a checkpoint packet into a message buffer.
Implemented in MAKLogger::DtLgrDisMessageState.
|
pure virtual |
Decode a linked checkpoint packet into a message buffer.
Implemented in MAKLogger::DtLgrDisMessageState.
|
virtual |
Destroys the snapshot.
|
virtual |
Event accessors.
|
virtual |
Find an object.
| 0 | If no object with the uniqueId is found. |
|
virtual |
Find an object.
| 0 | If no object with the uniqueId is found. |
|
virtual |
Find an object with the given name.
| 0 | If no object with the name is found. |
|
virtual |
Find an object with the given name.
| 0 | If no object with the name is found. |
|
protectedvirtual |
Find a state object for a packet.
| Valid | Pointer If object was found. |
| NULL | If object was not updated (due to not being found). |
|
pure virtual |
Generate a checkpoint packet from the current state.
Implemented in MAKLogger::DtLgrDisMessageState.
|
virtual |
Next update will generate only diff messages which are necessary to go from the backed up state to the current state.
|
virtual |
Return a message buffer with state messages of all cached objects and interactions.
| Output | |
| emptyBuffer | Contains the modified messages to send to recreate the state. |
|
virtual |
Get any cached interactions into the given buffer.
Set them with the given time and modify them desired.
|
virtual |
Create update packets at the given time for each object in the state and add them to the buffer.
|
virtual |
Event accessors.
|
virtual |
Get whether to collect interactions used for checkpoints.
|
virtual |
Get whether to collect interactions from checkpoints.
|
virtual |
Check to see if the State considers this packet a checkpoint.
Checkpoint messages are decoded to modify all objects.
|
pure virtual |
Check to see if the state thinks this is an interaction.
Implemented in MAKLogger::DtLgrDisMessageState.
|
pure virtual |
Check to see if the state thinks this is an object removal.
Implemented in MAKLogger::DtLgrDisMessageState.
|
pure virtual |
Check to see if the state thinks this is an object update.
Implemented in MAKLogger::DtLgrDisMessageState.
|
virtual |
Set/Get link checkpoint flag.
|
pure virtual |
Modify a packet.
This typically does not need to be called since it is internally called by update state.
| Output |
Implemented in MAKLogger::DtLgrDisMessageState.
|
virtual |
Calls modifyMessage for each packet in the buffer.
Modifies the messages. This typically does not need to be called since it is internally called by update state.
| Output |
Reimplemented in MAKLogger::DtLgrDisMessageState.
|
virtual |
Event accessors.
|
virtual |
Event accessors.
|
virtual |
Event accessors.
|
protected |
Assignment operator not implemented.
|
virtual |
Event accessors.
|
virtual |
Call post update after finished.
|
virtual |
Check to see if checkpoints affect the state.
|
protectedvirtual |
Remove the state object.
|
protectedvirtual |
Remove the state object based upon the packet.
| true | If object was removed. |
| false | If object was not removed (due to not being found). |
|
virtual |
Sets the Input Io Info.
|
virtual |
Set whether to collect interactions used for checkpoints.
|
virtual |
Set whether to collect interactions from checkpoints)
|
virtual |
Set/Get link checkpoint flag.
|
virtual |
Sets the Input Io Info.
|
virtual |
Set whether checkpoints affect the state.
|
virtual |
Set the state with the internal messages.
All objects not in the buffer are removed from the state.
| Input | |
| completeStateBuffer | Contains the messages used to create a specific state. |
| time | Time used for for diff messages |
| Output | |
| diffBuffer | If not null, populated with the modified messages that can create the new state from the old. Note: can be same buffer as completeStateBuffer |
|
virtual |
Start difference mode, creates snapshot of existing state to be used with.
|
virtual |
Event accessors.
|
virtual |
Event accessors.
|
virtual |
Event accessors.
|
virtual |
Gets a list of state objects.
|
virtual |
Update existing objects and add new objects.
Calls updateState for each packet in the message buffer.
| Input | |
| stateBuffer | Contains the messages used to create a specific state. |
| Output | |
| stateBuffer | Contains the modified messages to send to create the state. |
|
virtual |
Update existing objects and add new objects.
Calls udpateStateObjects on message. This function will not send event notifications. Call post update to send this value.
| Input | |
| packet | A packet to be added to the state. |
| Output | |
| message | The packet may be modified depending on the state's output. |
|
protectedvirtual |
Update the state object based upon the packet.
| Valid | Pointer If object was updated. |
| NULL | If object was not updated (due to not being found). |
|
protectedvirtual |
Used to update state objects using the packet.
Packet specific functions will be called here depending on the type of message.
| true | If state was modified. |
| false | If state was not modified. |
|
protected |
|
protected |
|
protected |
|
protected |
Events called on certain actions of the messageState.
|
protected |
Events called on certain actions of the messageState.
|
protected |
List of interactions received since last flush.
|
protected |
|
protected |
Events called on certain actions of the messageState.
|
protected |
Map to lookup state objects.
|
protected |
Map to lookup state objects.
|
protected |
List of state objects.
|
protected |
Events called on certain actions of the messageState.
|
protected |
Events called on certain actions of the messageState.
|
protected |
Events called on certain actions of the messageState.
|
protected |
The simulation manager.
|
protected |
List of objects used when diffing two different states.
|
protected |
Events called on certain actions of the messageState.
|
protected |
|
protected |
Events called on certain actions of the messageState.
|
protected |
Events called on certain actions of the messageState.