MAK Data Logger API Documentation for HLA
List of all members | 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:

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

Constructor & Destructor Documentation

MAKLogger::DtLgrEntityTracker::DtLgrEntityTracker ( )

CTOR.

virtual MAKLogger::DtLgrEntityTracker::~DtLgrEntityTracker ( )
virtual

DTOR.

MAKLogger::DtLgrEntityTracker::DtLgrEntityTracker ( const DtLgrEntityTracker )
private

Not Implemented.

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 EntryHandle MAKLogger::DtLgrEntityTracker::begin ( ) const
virtual

Returns the first valid entry handle.

virtual void MAKLogger::DtLgrEntityTracker::clearEntries ( )
virtual

Remove all entries.

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 void MAKLogger::DtLgrEntityTracker::deserializeFromString ( const DtString data)
virtual

Replace current state with serialized state in string.

virtual DtPacket* MAKLogger::DtLgrEntityTracker::encodePacket ( ) const
virtual

Encode tracker into packet.

virtual EntryHandle MAKLogger::DtLgrEntityTracker::end ( ) const
virtual

Returns an entry handle immediately beyond the last valid entry handle.

virtual int MAKLogger::DtLgrEntityTracker::entityCount ( ) const
virtual

Gets the number of entities currently in the tracker.

virtual double MAKLogger::DtLgrEntityTracker::entityFirstTime ( EntryHandle  handle) const
virtual

Returns the first time of indexed entity.

virtual DtForceType MAKLogger::DtLgrEntityTracker::entityForce ( const DtPacket packet) const
virtual

Returns force of a packet – protocol-specific.

Reimplemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.

virtual DtForceType MAKLogger::DtLgrEntityTracker::entityForce ( EntryHandle  handle) const
virtual

Returns the force of indexed entity.

virtual EntryHandle MAKLogger::DtLgrEntityTracker::entityId ( const DtPacket packet) const
virtual

Returns entity ID of a packet.

virtual double MAKLogger::DtLgrEntityTracker::entityLastTime ( EntryHandle  handle) const
virtual

Returns the last time of indexed entity.

virtual DtString MAKLogger::DtLgrEntityTracker::entityName ( const DtPacket packet) const
virtual

Returns unique entity name of a packet – protocol-specific.

Reimplemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.

virtual DtString MAKLogger::DtLgrEntityTracker::entityName ( EntryHandle  handle) const
virtual

Returns the name of indexed entity.

virtual DtString MAKLogger::DtLgrEntityTracker::entityType ( const DtPacket packet) const
virtual

Returns entity type of a packet – protocol-specific.

Reimplemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.

virtual DtString MAKLogger::DtLgrEntityTracker::entityType ( EntryHandle  handle) const
virtual

Returns the type of indexed entity.

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 bool MAKLogger::DtLgrEntityTracker::isPermanentEntry ( EntryHandle  handle) const
virtual

Returns whether the specified index is a known non-temporary entity.

virtual DtLgrEntityTracker::TrackerUpdateId MAKLogger::DtLgrEntityTracker::lastUpdateId ( ) const
virtual
DtLgrEntityTracker& MAKLogger::DtLgrEntityTracker::operator= ( const DtLgrEntityTracker )
private

Not Implemented.

virtual void MAKLogger::DtLgrEntityTracker::parsePacket ( const DtPacket packet)
virtual

Reads a packet to see if it updates any tracked entity info.

Reimplemented in MAKLogger::DtLgrHlaEntityTracker, and MAKLogger::DtLgrDisEntityTracker.

virtual DtString MAKLogger::DtLgrEntityTracker::serialize ( )
virtual

Return a serialized representation of current state.

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.

Member Data Documentation

TrackerEntryIndex MAKLogger::DtLgrEntityTracker::myEntityIndex
protected
TrackerUpdateId MAKLogger::DtLgrEntityTracker::myLastUpdateId
protected
DtLgrBaseSimManager* MAKLogger::DtLgrEntityTracker::myManager
protected
TrackerEntryList MAKLogger::DtLgrEntityTracker::myTrackedEntities
protected

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

Document ID: Generated on Sun Dec 15 18:04:30 EST 2013 from SVN revision 134418
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)