MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
MAKLogger::DtPacket Class Reference

A generic packed of typed binary data. More...

+ Collaboration diagram for MAKLogger::DtPacket:

Public Types

enum  DtPacketType {
  Type_Interaction = 0, Type_Update = 1, Type_Removal = 2, Type_Annotation = 3,
  Type_Pdu = 4, Type_Fom = 5, Type_Audio = 6, Type_Checkpoint = 7,
  Type_IndexTable = 8, Type_MultiTSUpdates = 9, Type_RecordingData = 11, Type_SimulationData = 12,
  Type_EntityTable = 13, Type_ConfigData = 14, Type_UpdateDDM = 15, Type_InteractionDDM = 16,
  Type_TapeTimeDate = 17, Type_Pause = 18, Type_Unpause = 19, Type_TapeDescription = 20,
  Type_StartEndTime = 21, Type_InitialState = 22, Type_None = 0x7FFFFFF0
}
 MIGRATION Info Same values as LtPacketKind in Logger 3.x versions. More...
 
enum  FilterType { Unfiltered, Filtered, Dropped }
 

Public Member Functions

 ~DtPacket ()
 DTOR which releases resources. More...
 
void operator delete (void *v, size_t t)
 Customized delete packet. More...
 
bool operator< (const DtPacket &) const
 Check to see if this packet comes before another packet. More...
 
FilterType filter () const
 Get the filter setting applied to this packet. More...
 
size_t size () const
 Get the size of the packet's data in bytes. More...
 
const DtAbsoluteTimetime () const
 Get the time of the packet. More...
 
int type () const
 Get the type of the packet. More...
 
const char * typeString () const
 Return the string representation of the type. More...
 
DtLgrEntityTracker::EntryHandle entityTrackingId () const
 Get the entity tracking ID of the packet. More...
 
void setEntityTrackingId (DtLgrEntityTracker::EntryHandle id)
 Set the entity tracking ID of the packet. More...
 
void setFilter (FilterType filter)
 
void setTime (DtAbsoluteTime time)
 
void setType (int type)
 
void addAttribute (DtPacketAttributeSP)
 Add integer mapped attributes. More...
 
bool removeAttribute (int)
 Removes the attribute. More...
 
DtPacketAttributeSP lookupAttribute (int)
 Lookup attribute, fairly fast. More...
 
void convertTime (DtAbsoluteTime inputCurrentTime, DtAbsoluteTime outputCurrentTime)
 
char * data ()
 Get the data pointer. More...
 
const char * data () const
 Get the data pointer. More...
 
bool isFromPast () const
 Set/Get whether packet represents data from before tape begins. More...
 
void setIsFromPast (bool val)
 Set/Get whether packet represents data from before tape begins. More...
 
bool isStateUpdate () const
 Set/Get whether packet represents data from state messages. More...
 
void setIsStateUpdate (bool val)
 Set/Get whether packet represents data from state messages. More...
 
DtSmartBufferbuffer ()
 Get the internal buffer of the packet. More...
 
const DtSmartBufferbuffer () const
 Get the internal buffer of the packet. More...
 

Static Public Member Functions

static DtPacketcreate (DtSmartBuffer data, DtAbsoluteTime time, int type, int id=-1)
 CTOR which takes a shared smart buffer and the time and type. More...
 
static DtPacketcreate (size_t size, DtAbsoluteTime time, int type, int id=-1)
 CTOR which defines the size, which will create it's own smart buffer. More...
 
static DtAbsoluteTime convertTime (DtAbsoluteTime inputCurrentTime, DtAbsoluteTime outputCurrentTime, DtAbsoluteTime arrivalTime)
 Convert the arrivalTime using both the Current Input time, and the current ouputTime. More...
 
static const char * typeToString (DtPacketType packetType)
 String representation of packet type. More...
 

Protected Member Functions

 DtPacket (DtSmartBuffer data, DtAbsoluteTime time, int type, int id)
 
 DtPacket (size_t size, DtAbsoluteTime time, int type, int id)
 CTOR which defines the size, which will create it's own smart buffer. More...
 
void * operator new (size_t t)
 

Protected Attributes

DtAbsoluteTime myTime
 The time of the packet (typically the arrival time) More...
 
bool myIsFromPast
 Indicates whether packet is from before tape start (idle listening) More...
 
bool myIsStateUpdate
 Indicates whether packet an update from state messages. More...
 
DtLgrEntityTracker::EntryHandle myEntityTrackingId
 
int myType
 The type of packet. More...
 
FilterType myFilterCondition
 The filter condition of a packet Initially DtUnfiltered. More...
 
DtSmartBuffer myData
 Pointer to packet data. More...
 
std::list< DtPacketAttributeSPmyAttributes
 Attribute list, initially NULL. More...
 
static DtPackettheFirstPacket
 Deallocate the chunks of data used. More...
 
static DtMutex thePacketListMutex
 Deallocate the chunks of data used. More...
 
static std::vector< char * > theMemoryChunks
 Deallocate the chunks of data used. More...
 
static char * currentMemory
 Deallocate the chunks of data used. More...
 
static char * endMemory
 Deallocate the chunks of data used. More...
 
DtPacketnext
 Deallocate the chunks of data used. More...
 
static void deleteChunks ()
 Deallocate the chunks of data used. More...
 

Detailed Description

A generic packed of typed binary data.

Member Enumeration Documentation

MIGRATION Info Same values as LtPacketKind in Logger 3.x versions.

Enumerator
Type_Interaction 
Type_Update 
Type_Removal 
Type_Annotation 
Type_Pdu 
Type_Fom 
Type_Audio 
Type_Checkpoint 
Type_IndexTable 
Type_MultiTSUpdates 
Type_RecordingData 

New for 4.0, multiple time stamped updates.

Type_GeneratedUpdate = 10, //! New for 4.0 use the time of the packet when //! sending.

Type_SimulationData 
Type_EntityTable 
Type_ConfigData 

entity metadata

Type_UpdateDDM 

configuration metadata

These two are new for Logger 4.4

Type_InteractionDDM 

update with DDM region data (Only makes sense for HLA)

Type_TapeTimeDate 

interaction with DDM data (Only makes sense for HLA)

Type_Pause 
Type_Unpause 
Type_TapeDescription 
Type_StartEndTime 
Type_InitialState 
Type_None 
Enumerator
Unfiltered 
Filtered 
Dropped 

Constructor & Destructor Documentation

MAKLogger::DtPacket::~DtPacket ( )

DTOR which releases resources.

MAKLogger::DtPacket::DtPacket ( DtSmartBuffer  data,
DtAbsoluteTime  time,
int  type,
int  id 
)
protected
MAKLogger::DtPacket::DtPacket ( size_t  size,
DtAbsoluteTime  time,
int  type,
int  id 
)
protected

CTOR which defines the size, which will create it's own smart buffer.

Member Function Documentation

void MAKLogger::DtPacket::addAttribute ( DtPacketAttributeSP  )

Add integer mapped attributes.

Used to store cached data. The integer must be >= 0 or add will quietly fail.

DtSmartBuffer& MAKLogger::DtPacket::buffer ( )

Get the internal buffer of the packet.

const DtSmartBuffer& MAKLogger::DtPacket::buffer ( ) const

Get the internal buffer of the packet.

void MAKLogger::DtPacket::convertTime ( DtAbsoluteTime  inputCurrentTime,
DtAbsoluteTime  outputCurrentTime 
)
static DtAbsoluteTime MAKLogger::DtPacket::convertTime ( DtAbsoluteTime  inputCurrentTime,
DtAbsoluteTime  outputCurrentTime,
DtAbsoluteTime  arrivalTime 
)
static

Convert the arrivalTime using both the Current Input time, and the current ouputTime.

static DtPacket* MAKLogger::DtPacket::create ( DtSmartBuffer  data,
DtAbsoluteTime  time,
int  type,
int  id = -1 
)
static

CTOR which takes a shared smart buffer and the time and type.

static DtPacket* MAKLogger::DtPacket::create ( size_t  size,
DtAbsoluteTime  time,
int  type,
int  id = -1 
)
static

CTOR which defines the size, which will create it's own smart buffer.

char* MAKLogger::DtPacket::data ( )

Get the data pointer.

const char* MAKLogger::DtPacket::data ( ) const

Get the data pointer.

static void MAKLogger::DtPacket::deleteChunks ( )
staticprivate

Deallocate the chunks of data used.

DtLgrEntityTracker::EntryHandle MAKLogger::DtPacket::entityTrackingId ( ) const

Get the entity tracking ID of the packet.

FilterType MAKLogger::DtPacket::filter ( ) const

Get the filter setting applied to this packet.

bool MAKLogger::DtPacket::isFromPast ( ) const

Set/Get whether packet represents data from before tape begins.

bool MAKLogger::DtPacket::isStateUpdate ( ) const

Set/Get whether packet represents data from state messages.

DtPacketAttributeSP MAKLogger::DtPacket::lookupAttribute ( int  )

Lookup attribute, fairly fast.

Return values
nullAttribute was not found.
void MAKLogger::DtPacket::operator delete ( void *  v,
size_t  t 
)

Customized delete packet.

void* MAKLogger::DtPacket::operator new ( size_t  t)
protected
bool MAKLogger::DtPacket::operator< ( const DtPacket ) const

Check to see if this packet comes before another packet.

bool MAKLogger::DtPacket::removeAttribute ( int  )

Removes the attribute.

Return values
trueAttribute was removed.
falseAttribute was not removed (due to not being found).
void MAKLogger::DtPacket::setEntityTrackingId ( DtLgrEntityTracker::EntryHandle  id)

Set the entity tracking ID of the packet.

void MAKLogger::DtPacket::setFilter ( FilterType  filter)
void MAKLogger::DtPacket::setIsFromPast ( bool  val)

Set/Get whether packet represents data from before tape begins.

void MAKLogger::DtPacket::setIsStateUpdate ( bool  val)

Set/Get whether packet represents data from state messages.

void MAKLogger::DtPacket::setTime ( DtAbsoluteTime  time)
void MAKLogger::DtPacket::setType ( int  type)
size_t MAKLogger::DtPacket::size ( ) const

Get the size of the packet's data in bytes.

const DtAbsoluteTime& MAKLogger::DtPacket::time ( ) const

Get the time of the packet.

int MAKLogger::DtPacket::type ( ) const

Get the type of the packet.

const char* MAKLogger::DtPacket::typeString ( ) const

Return the string representation of the type.

static const char* MAKLogger::DtPacket::typeToString ( DtPacketType  packetType)
static

String representation of packet type.

Member Data Documentation

char* MAKLogger::DtPacket::currentMemory
staticprivate

Deallocate the chunks of data used.

char* MAKLogger::DtPacket::endMemory
staticprivate

Deallocate the chunks of data used.

std::list<DtPacketAttributeSP> MAKLogger::DtPacket::myAttributes
protected

Attribute list, initially NULL.

DtSmartBuffer MAKLogger::DtPacket::myData
protected

Pointer to packet data.

DtLgrEntityTracker::EntryHandle MAKLogger::DtPacket::myEntityTrackingId
protected
FilterType MAKLogger::DtPacket::myFilterCondition
protected

The filter condition of a packet Initially DtUnfiltered.

bool MAKLogger::DtPacket::myIsFromPast
protected

Indicates whether packet is from before tape start (idle listening)

bool MAKLogger::DtPacket::myIsStateUpdate
protected

Indicates whether packet an update from state messages.

DtAbsoluteTime MAKLogger::DtPacket::myTime
protected

The time of the packet (typically the arrival time)

int MAKLogger::DtPacket::myType
protected

The type of packet.

DtPacket* MAKLogger::DtPacket::next
private

Deallocate the chunks of data used.

DtPacket* MAKLogger::DtPacket::theFirstPacket
staticprivate

Deallocate the chunks of data used.

std::vector<char*> MAKLogger::DtPacket::theMemoryChunks
staticprivate

Deallocate the chunks of data used.

DtMutex MAKLogger::DtPacket::thePacketListMutex
staticprivate

Deallocate the chunks of data used.


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

Document ID: Generated on Thu Jul 14 15:45:33 EDT 2022 from SVN revision 244827
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)