![]() |
MAK Data Logger API Documentation for HLA
|
Indexes packets in a file. More...
Inheritance diagram for MAKLogger::DtLgrEntityTracker:
Collaboration diagram for MAKLogger::DtLgrEntityTracker:Classes | |
| struct | NetTrackerEntryHeader |
| The entries stored in the packet. More... | |
| struct | NetTrackerTable |
| The table stored at the beginning of the packet followed by the net entries. More... | |
| struct | TrackerEntry |
| An entry in the list of tracked entities Constructor used for const value. More... | |
Public Types | |
| typedef int | TrackerUpdateId |
| typedef int | EntryHandle |
| typedef std::set < DtLgrEntityTracker::EntryHandle > | EntryHandleSet |
Public Member Functions | |
| virtual | ~DtLgrEntityTracker () |
| DTOR. More... | |
| virtual void | simInitialize (DtLgrBaseSimManager *simMgr) |
| After connecting to the simulation, perform some initialization. More... | |
| virtual EntryHandle | begin () const |
| Returns the first valid entry handle. More... | |
| virtual EntryHandle | end () const |
| Returns an entry handle immediately beyond the last valid entry handle. More... | |
| virtual DtLgrEntityTracker::TrackerUpdateId | lastUpdateId () const |
| Return a counter which when compared to a previously retrieved value indicates that this tracker has been updated if the values are different. More... | |
| virtual EntryHandle | addEntry (double firstTime, double lastTime, const DtString &name, const DtString &type, DtForceType force, const DtString &marking, DtLgrEntityTracker::EntryHandle handle=-1) |
| Adds a tracked entry using the provided data. More... | |
| virtual EntryHandle | addEntry (const TrackerEntry &entry, DtLgrEntityTracker::EntryHandle handle=-1) |
| Adds the given tracked entry. More... | |
| virtual EntryHandle | addTemporaryEntry (const DtString &name) |
| Adds a temporary entry with the given name that will not be saved across tape loads. More... | |
| virtual EntryHandle | addTemporaryMarking (const DtString &marking) |
| Adds a temporary entry with the given marking and since a name is necessary the marking will also be used as its name. More... | |
| virtual EntryHandle | findEntry (const DtString &name) const |
| Looks up an entry. More... | |
| virtual int | entityCount () const |
| Gets the number of entities currently in the tracker. More... | |
| virtual void | clearEntries () |
| Remove all entries. More... | |
| virtual bool | isPermanentEntry (EntryHandle handle) const |
| Returns whether the specified index is a known non-temporary entity. More... | |
| virtual const TrackerEntry & | entry (DtLgrEntityTracker::EntryHandle handle) const |
| Return the entry with the given handle. More... | |
| virtual double | entityFirstTime (EntryHandle handle) const |
| Returns the first time of indexed entity. More... | |
| virtual double | entityLastTime (EntryHandle handle) const |
| Returns the last time of indexed entity. More... | |
| virtual DtString | entityName (EntryHandle handle) const |
| Returns the name of indexed entity. More... | |
| virtual DtString | entityType (EntryHandle handle) const |
| Returns the type of indexed entity. More... | |
| virtual DtForceType | entityForce (EntryHandle handle) const |
| Returns the force of indexed entity. More... | |
| virtual DtString | entityMarking (EntryHandle handle) const |
| Returns the marking of indexed entity. More... | |
| virtual void | parsePacket (const DtPacket &packet, const DtAbsoluteTime *time=0) |
| Reads a packet to update tracked entity info Use time for packet if given; otherwise, use packet time. More... | |
| virtual void | parsePackets (const DtMessageBuffer &packetBuffer, const DtAbsoluteTime *time=0) |
| Reads a buffer of packets to update tracked entity info Use time for packets if given. More... | |
| virtual EntryHandle | entityId (const DtPacket &packet) const |
| Returns entry handle of the entity in the packet if packet specifies an entity and the entity is already tracked; otherwise, entry handle is invalid. More... | |
| virtual int | encodedSize () const |
| Return size of encoded data. More... | |
| virtual DtPacket * | encodePacket () const |
| Encode tracker into packet. More... | |
| virtual void | decodePacket (const DtPacket *) |
| Decode tracker table packet. More... | |
| virtual void | deserializeFromString (const DtString &data) |
| Replace current state with serialized state in string. More... | |
| virtual DtString | serialize () |
| Return a serialized representation of current state. More... | |
| virtual DtString | serializeAdded () |
| Return a serialized representation of current state. More... | |
| virtual DtLgrEntityTracker * | createFromPacket (const DtPacket &packet)=0 |
| Data extractors to be implemented by protocol specific derivations. More... | |
| virtual DtString | entityName (const DtPacket &packet) const =0 |
| Returns unique entity name of a packet – protocol-specific. More... | |
| virtual DtString | entityType (const DtPacket &packet) const =0 |
| Returns entity type of a packet – protocol-specific. More... | |
| virtual DtForceType | entityForce (const DtPacket &packet) const =0 |
| Returns force of a packet – protocol-specific. More... | |
| virtual DtString | entityMarking (const DtPacket &packet) const =0 |
| Returns entity marking of a packet – protocol-specific. More... | |
Protected Types | |
| enum | TrackedDataIndex { DtTrackName = 0, DtTrackType = 1, DtTrackMarking = 2 } |
| typedef std::vector< TrackerEntry > | TrackerEntryList |
| The format encoded in the entity table packet (all in network byte order) is as follows: More... | |
| typedef std::map< DtString, EntryHandle > | TrackerEntryIndex |
Protected Member Functions | |
| virtual TrackerEntry | makeInvalidEntry () const |
| Makes an empty tracker entry. More... | |
| virtual unsigned | encodedEntrySize (const TrackerEntry &entry, bool includePadding=true) const |
| Return the size required to encode the given entry. Size of padding is included by default. More... | |
| virtual char * | encodeEntry (char *entryData, const TrackerEntry &entry) const |
| Encode tracker entry into the given data buffer. More... | |
| virtual const char * | decodeEntry (const char *entryData) |
| Decode tracker entry data and add the entry to the table. More... | |
| virtual void | advanceToNextToken (const char *&data, const char *dataEnd) |
| Skip over current token and get pointer to the next token in serialized buffer. More... | |
| bool | getFloat (const char *&token, const char *dataEnd, const DtString &tokenName, float &value) |
| bool | getInt (const char *&token, const char *dataEnd, const DtString &tokenName, int &value) |
| bool | getString (const char *&token, const char *dataEnd, const DtString &tokenName, DtString &value) |
| virtual void | deserializeEntryFromString (const char **data, const char *dataEnd) |
| Deserialize an entry from the given data up to the given end. More... | |
| virtual void | serializeEntry (DtString &serialized, unsigned index, const TrackerEntry &entry) |
| Append the entry with the given index to the given serialized data. More... | |
Protected Attributes | |
| DtLgrBaseSimManager * | mySimMgr |
| The simulation manager. More... | |
| TrackerEntryList | myTrackedEntities |
| The tracked entities. More... | |
| std::map< unsigned int, TrackerEntry > | myAddedEntities |
| Recently added tracked entities (as of last serialize) Includes temporary entities. More... | |
| TrackerEntryIndex | myEntityIndex |
| Map of tracked entity handles by name. More... | |
| TrackerUpdateId | myLastUpdateId |
| The update ID counter. More... | |
| int | myNumberTrackedData |
| Number of variable tracked data in an encoded entry. More... | |
| int | myAlignmentSize |
| Byte alignment size. More... | |
| const TrackerEntry | myInvalidEntry |
| An invalid entry. More... | |
| const char | myFieldSeparator |
| Serialize field separator. More... | |
| const DtString | myFieldSeparatorString |
| Serialize field separator. More... | |
Static Protected Attributes | |
| static DtString | theSerializeLabel |
Private Member Functions | |
| DtLgrEntityTracker (const DtLgrEntityTracker &) | |
| Not Implemented. More... | |
| DtLgrEntityTracker & | operator= (const DtLgrEntityTracker &) |
| Not Implemented. More... | |
Indexes packets in a file.
| typedef int MAKLogger::DtLgrEntityTracker::EntryHandle |
| typedef std::set<DtLgrEntityTracker::EntryHandle> MAKLogger::DtLgrEntityTracker::EntryHandleSet |
|
protected |
|
protected |
The format encoded in the entity table packet (all in network byte order) is as follows:
Header:
DtNetU32 numEntries: total number of entities in the tracker DtNetU32 unused: number of blank entities at the end
Entries:
DtNetFloat64 firstTime: the first time the entity appears DtNetFloat64 lastTime: the last time the entity appears DtNetInt32 entrySize: total size in bytes of this entry, also the offset to the next entry DtNetInt32 force: the force ID of the entity DtNetInt32 dataSizes[3] - name, type, marking char[nameSize] name: the name as a C string char[typeSize] type: the type as a C string char[markingSize] marking: the type as a C string char[0-8] padding: padding to bring entrySize to a multiple of eight, all zeroes
| typedef int MAKLogger::DtLgrEntityTracker::TrackerUpdateId |
|
protected |
|
virtual |
DTOR.
|
private |
Not Implemented.
|
virtual |
Adds a tracked entry using the provided data.
If entry handle is provided and valid, the entry replaces the existing one; otherwise entry is appended to end.
|
virtual |
Adds the given tracked entry.
If entry handle is provided and valid, the entry replaces the existing one; otherwise entry is appended to end.
|
virtual |
Adds a temporary entry with the given name that will not be saved across tape loads.
If it already exists as either a normal or temporary entry, the existing handle will be returned.
|
virtual |
Adds a temporary entry with the given marking and since a name is necessary the marking will also be used as its name.
The entry will not be saved across tape loads. If it already exists as either a normal or temporary entry, the existing handle will be returned.
|
protectedvirtual |
Skip over current token and get pointer to the next token in serialized buffer.
|
virtual |
Returns the first valid entry handle.
|
virtual |
Remove all entries.
|
pure virtual |
Data extractors to be implemented by protocol specific derivations.
Create a tracker from table packet. A new tracker with the decoded data will be returned. throw DtInvalidInput if the packet is not an entity tracker table packet.
Implemented in MAKLogger::DtLgrHlaEntityTracker, MAKLogger::DtLgrDisEntityTracker, and MAKLogger::DtLgrHlaLegacyEntityTracker.
|
protectedvirtual |
Decode tracker entry data and add the entry to the table.
Return the end of the encoded entry data.
Reimplemented in MAKLogger::DtLgrHlaLegacyEntityTracker.
|
virtual |
Decode tracker table packet.
The existing entries will be cleared and replaced with the entries stored in the packet. throw DtInvalidInput if the packet is not an entity tracker table packet.
|
protectedvirtual |
Deserialize an entry from the given data up to the given end.
Data is advanced past entry.
|
virtual |
Replace current state with serialized state in string.
|
protectedvirtual |
Return the size required to encode the given entry. Size of padding is included by default.
Reimplemented in MAKLogger::DtLgrHlaLegacyEntityTracker.
|
virtual |
Return size of encoded data.
|
protectedvirtual |
Encode tracker entry into the given data buffer.
Return the end of the encoded entry data.
Reimplemented in MAKLogger::DtLgrHlaLegacyEntityTracker.
|
virtual |
Encode tracker into packet.
|
virtual |
Returns an entry handle immediately beyond the last valid entry handle.
|
virtual |
Gets the number of entities currently in the tracker.
|
virtual |
Returns the first time of indexed entity.
|
virtual |
Returns the force of indexed entity.
|
pure virtual |
Returns force of a packet – protocol-specific.
Implemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.
|
virtual |
Returns entry handle of the entity in the packet if packet specifies an entity and the entity is already tracked; otherwise, entry handle is invalid.
|
virtual |
Returns the last time of indexed entity.
|
virtual |
Returns the marking of indexed entity.
|
pure virtual |
Returns entity marking of a packet – protocol-specific.
Implemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.
|
virtual |
Returns the name of indexed entity.
|
pure virtual |
Returns unique entity name of a packet – protocol-specific.
Implemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.
|
virtual |
Returns the type of indexed entity.
|
pure virtual |
Returns entity type of a packet – protocol-specific.
Implemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.
|
virtual |
Return the entry with the given handle.
Invalid entry is returned if handle is invalid.
|
virtual |
Looks up an entry.
|
protected |
|
protected |
|
protected |
|
virtual |
Returns whether the specified index is a known non-temporary entity.
|
virtual |
Return a counter which when compared to a previously retrieved value indicates that this tracker has been updated if the values are different.
|
protectedvirtual |
Makes an empty tracker entry.
|
private |
Not Implemented.
|
virtual |
Reads a packet to update tracked entity info Use time for packet if given; otherwise, use packet time.
Reimplemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.
|
virtual |
Reads a buffer of packets to update tracked entity info Use time for packets if given.
|
virtual |
Return a serialized representation of current state.
|
virtual |
Return a serialized representation of current state.
|
protectedvirtual |
Append the entry with the given index to the given serialized data.
|
virtual |
After connecting to the simulation, perform some initialization.
Must be called after each connection. Only required with derived trackers that need to decode info e.g., HLA tracker using FOM to find type and force attribute handles
Reimplemented in MAKLogger::DtLgrHlaEntityTracker.
|
protected |
Recently added tracked entities (as of last serialize) Includes temporary entities.
|
protected |
Byte alignment size.
|
protected |
Map of tracked entity handles by name.
|
protected |
Serialize field separator.
|
protected |
Serialize field separator.
|
protected |
An invalid entry.
|
protected |
The update ID counter.
|
protected |
Number of variable tracked data in an encoded entry.
|
protected |
The simulation manager.
|
protected |
The tracked entities.
|
staticprotected |