![]() |
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 |
| struct | NetInitialStateHeader |
Public Types | |
| 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 | |
| virtual | ~DtMessageState () |
| DTOR Will destroy all state objects. More... | |
| virtual const DtLgrSimManager * | simMgr () 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 void | modifyMessages (DtMessageBuffer &messages) const |
| Calls modifyMessage for each packet in the buffer. More... | |
| virtual void | modifyMessage (DtPacket &packet) const =0 |
| Modify a packet. 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 bool | isUpdateMessage (const DtPacket &packet) const =0 |
| Check to see if the state thinks this is an object update. More... | |
| virtual bool | isRemovalMessage (const DtPacket &packet) const =0 |
| Check to see if the state thinks this is an object removal. More... | |
| virtual bool | isInteractionMessage (const DtPacket &packet) const =0 |
| Check to see if the state thinks this is an interaction. 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 DtPacket * | createRemoval (const DtStateObject &object, const DtAbsoluteTime &time) const =0 |
| Create an removal packet for the object at the given time. More... | |
| virtual DtStateObject * | findObject (DtU64 uniqueId) |
| Find an object. More... | |
| virtual const DtStateObject * | findObject (DtU64 uniqueId) const |
| Find an object. More... | |
| virtual DtStateObject * | findObjectByName (const DtString &name) |
| Find an object with the given name. More... | |
| virtual const DtStateObject * | findObjectByName (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... | |
Abstract message state interface. | |
| 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 void | decodeInitialState (const DtPacket &packet, DtMessageBuffer &buffer)=0 |
| Decode an initial state packet into a message buffer. More... | |
| virtual void | decodeCheckpoint (const DtPacket &packet, DtMessageBuffer &buffer, bool includeInteractions)=0 |
| Decode a checkpoint packet into a message buffer. More... | |
| virtual void | decodeLinkedCheckpoint (const DtPacket &packet, DtMessageBuffer &buffer, bool includeInteractions)=0 |
| Decode a linked checkpoint packet into a message buffer. More... | |
| virtual DtPacket * | generateInitialState (const DtAbsoluteTime ×tamp, const DtAbsoluteTime ¤tTime, bool isTransition) |
| Generates an initial state packet containing the current state. More... | |
| virtual DtPacket * | generateCheckpoint (const DtAbsoluteTime ×tamp, 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 Types | |
| 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... | |
Protected Member Functions | |
| DtMessageState (const DtLgrSimManager *simMgr=0) | |
| Protected CTOR since class is abstract. More... | |
| DtMessageState (const DtMessageState &) | |
| CopyCTOR not implemented. More... | |
| DtMessageState & | operator= (const DtMessageState &) |
| Assignment operator not implemented. More... | |
| virtual void | activateState ()=0 |
| Activate the protocol specific state. More... | |
| virtual void | deactivateState ()=0 |
| Deactivate the protocol specific state. More... | |
| virtual DtPacket * | createInitialStatePacket (const DtMessageBuffer &initialStateBuffer, const DtAbsoluteTime ×tamp, double offsetTime)=0 |
| 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 DtPacket * | createCheckpointPacket (const DtMessageBuffer &checkpointBuffer, const DtAbsoluteTime ×tamp)=0 |
| Return a checkpoint packet filled with the state data from the given buffer. More... | |
| virtual bool | updateStateObjects (const DtPacket &packet) |
| Used to update state objects using the packet. More... | |
| virtual DtStateObject * | createStateObject (const DtPacket &packet) |
| Create the state object based upon the packet. More... | |
| virtual DtStateObject * | updateStateObject (const DtPacket &packet) |
| Update the state object based upon the packet. More... | |
| virtual DtStateObject * | findStateObject (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... | |
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 |
Add objects from buffer to the state.
|
protectedvirtual |
Clear the interaction list.
|
protectedvirtual |
Clear the object list.
If provided, fill the message buffer with updates of the emptied state using the given time.
|
protectedvirtual |
Clear the object list.
|
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.
|
protectedpure virtual |
Return a checkpoint packet filled with the state data from the given buffer.
Implemented in MAKLogger::DtLgrDisMessageState.
|
protectedpure virtual |
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.
Implemented in MAKLogger::DtLgrDisMessageState.
|
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 if provided.
|
protectedvirtual |
Create update packet(s) for the object at the given time if provided 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 an initial state 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). |
|
virtual |
Generates a checkpoint packet containing the current state including received interactions if specified.
The generated packet is given the provided timestamp.
|
virtual |
Next update will generate only diff messages which are necessary to go from the backed up state to the current state.
|
virtual |
Generates an initial state packet containing the current state.
The current time is used to calculate an offset to the packet with the earliest timestamp. The generated packet is given the provided timestamp. Enable isTransition if this state is being generated to transition across an edit.
|
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.
|
virtual |
Indicates if a diff is in progress.
|
virtual |
Check to see if the State considers this packet an initial state.
Initial state 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 |
Return the sim manager.
|
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 |
|
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.
|
protected |