Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes | Private Member Functions
MAKLogger::DtLgrEntityTracker Class Reference

Indexes packets in a file. More...

+ Inheritance diagram for MAKLogger::DtLgrEntityTracker:
+ Collaboration diagram for MAKLogger::DtLgrEntityTracker:

List of all members.

Classes

struct  NetTrackerEntry
 A tracker entry used for encoding. More...
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 internal list of tracked entities. More...

Public Types

typedef int EntryHandle
typedef int TrackerUpdateId

Public Member Functions

 DtLgrEntityTracker ()
 CTOR.
virtual ~DtLgrEntityTracker ()
 DTOR.
virtual void parsePacket (const DtPacket &packet)
 Reads a packet to see if it updates any tracked entity info.
virtual EntryHandle addEntry (double firstTime, double lastTime, const DtString &name, const DtString &type, DtForceType force, DtLgrEntityTracker::EntryHandle handle=-1)
 Adds an entry for a first time, last time, and name.
virtual EntryHandle addTemporaryEntry (const DtString &name)
 Adds a temporary entry that will not be saved across tape loads.
virtual EntryHandle findEntry (const DtString &name) const
 Looks up an entry.
virtual void clearEntries ()
 Remove all entries.
virtual int entityCount () const
 Gets the number of entities currently in the tracker.
virtual EntryHandle entityId (const DtPacket &packet) const
 Returns entity ID of a packet.
virtual DtString entityName (const DtPacket &packet) const
 Returns unique entity name of a packet -- protocol-specific.
virtual DtString entityType (const DtPacket &packet) const
 Returns entity type of a packet -- protocol-specific.
virtual DtForceType entityForce (const DtPacket &packet) const
 Returns force of a packet -- protocol-specific.
virtual DtPacketencodePacket () const
 Encode tracker into packet.
virtual void decodePacket (const DtPacket *)
 Decode tracker table packet.
virtual double entityFirstTime (EntryHandle handle) const
 Returns the first time of indexed entity.
virtual double entityLastTime (EntryHandle handle) const
 Returns the last time of indexed entity.
virtual DtString entityName (EntryHandle handle) const
 Returns the name of indexed entity.
virtual DtString entityType (EntryHandle handle) const
 Returns the type of indexed entity.
virtual DtForceType entityForce (EntryHandle handle) const
 Returns the force of indexed entity.
virtual bool isPermanentEntry (EntryHandle handle) const
 Returns whether the specified index is a known non-temporary entity.
virtual void deserializeFromString (const DtString &data)
 Replace current state with serialized state in string.
virtual DtString serialize ()
 Return a serialized representation of current state.
virtual void setManager (DtLgrBaseSimManager *manager)
 Set the tracker's associated sim manager This is only required within subclassed trackers that require a sim manager connection to decode some of the info, for instance the HLA trackers that need FOM info to find the type and force.
virtual EntryHandle begin () const
 Returns the first valid entry handle.
virtual EntryHandle end () const
 Returns an entry handle immediately beyond the last valid entry handle.
virtual
DtLgrEntityTracker::TrackerUpdateId 
lastUpdateId () const

Protected Types

typedef std::vector< TrackerEntryTrackerEntryList
 The format encoded in the entity table packet (all in network byte order) is as follows:
typedef std::map< DtString,
EntryHandle > 
TrackerEntryIndex

Protected Attributes

TrackerEntryList myTrackedEntities
TrackerEntryIndex myEntityIndex
DtLgrBaseSimManagermyManager
TrackerUpdateId myLastUpdateId

Private Member Functions

 DtLgrEntityTracker (const DtLgrEntityTracker &)
 Not Implemented.
DtLgrEntityTrackeroperator= (const DtLgrEntityTracker &)
 Not Implemented.

Detailed Description

Indexes packets in a file.


Member Typedef Documentation

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:

DtNetInt32 entrySize: total size in bytes of this entry, also the offset to the next entry DtNetFloat64 firstTime: the first time the entity appears DtNetFloat64 lastTime: the last time the entity appears DtNetInt32 force: the force ID of the entity DtNetInt32 nameSize: the number of bytes in the name DtNetInt32 typeSize: the number of bytes in the type char[nameSize] name: the name as a C string char[typeSize] type: the type as a C string char[0-3] padding: padding to bring entrySize to a multiple of four, all zeroes


Member Function Documentation

virtual EntryHandle MAKLogger::DtLgrEntityTracker::addEntry ( double  firstTime,
double  lastTime,
const DtString name,
const DtString type,
DtForceType  force,
DtLgrEntityTracker::EntryHandle  handle = -1 
) [virtual]

Adds an entry for a first time, last time, and name.

Returns:
the handle of the entry.
virtual EntryHandle MAKLogger::DtLgrEntityTracker::addTemporaryEntry ( const DtString name) [virtual]

Adds a temporary entry 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.

Returns:
the handle of the entry.
virtual void MAKLogger::DtLgrEntityTracker::decodePacket ( const DtPacket ) [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.

virtual EntryHandle MAKLogger::DtLgrEntityTracker::findEntry ( const DtString name) const [virtual]

Looks up an entry.

Returns:
the handle of the entry or -1 on failure
virtual void MAKLogger::DtLgrEntityTracker::setManager ( DtLgrBaseSimManager manager) [virtual]

Set the tracker's associated sim manager This is only required within subclassed trackers that require a sim manager connection to decode some of the info, for instance the HLA trackers that need FOM info to find the type and force.


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

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)