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

Indexes packets in a file. More...

+ Collaboration diagram for MAKLogger::DtLgrPacketIndexer:

List of all members.

Classes

struct  IndexEntry
struct  NetIndexEntry
 The entries stored in the packet. More...
struct  NetIndexTable
 The table stored at the beginning of the packet followed by the net entries. More...

Public Member Functions

 DtLgrPacketIndexer ()
 CTOR.
 ~DtLgrPacketIndexer ()
 DTOR.
int addEntry (double time, DtFilePosition position, int size)
 Adds a index for a position, time and size.
void removeEntry (int index)
 Remove an entry.
void clearEntries ()
 Remove all entries.
int firstIndex ()
 Get the first index or -1 if no indices.
int lastIndex ()
 Get the last index or -1 if no indices.
int indexCount () const
 Gets the number of indices currently in the indexer.
int getIndexAtOrBeforeTime (double time)
 Gets the first position before time.
int getIndexAtOrAfterTime (double time)
 Gets the first position after the time.
DtFilePosition getPositionOfIndex (int index)
 Gets the position at the index.
double getTimeOfIndex (int index)
 Gets the time of the index.
int getSizeOfIndex (int index)
 Gets the size of the entry at the index.
DtPacketencodePacket () const
 Encode index into packet.
void decodePacket (const DtPacket *packet)
 Decode index packet.

Protected Types

typedef std::vector< IndexEntryCheckpointEntryList

Protected Attributes

CheckpointEntryList myCheckpointEntries

Private Member Functions

 DtLgrPacketIndexer (const DtLgrPacketIndexer &)
 Not Implemented.
DtLgrPacketIndexeroperator= (const DtLgrPacketIndexer &)
 Not Implemented.

Detailed Description

Indexes packets in a file.


Member Function Documentation

int MAKLogger::DtLgrPacketIndexer::addEntry ( double  time,
DtFilePosition  position,
int  size 
)

Adds a index for a position, time and size.

Returns:
the index of the entry.
void MAKLogger::DtLgrPacketIndexer::decodePacket ( const DtPacket packet)

Decode index packet.

The existing entries will be cleared and replaced with the entries stored in the packet. throw DtInvalidInput if the packet is not an index table packet.

int MAKLogger::DtLgrPacketIndexer::firstIndex ( )

Get the first index or -1 if no indices.

Return values:
-1no indices.
int MAKLogger::DtLgrPacketIndexer::getIndexAtOrAfterTime ( double  time)

Gets the first position after the time.

throw DtInvalidInput if the time is after the last time.

int MAKLogger::DtLgrPacketIndexer::getIndexAtOrBeforeTime ( double  time)

Gets the first position before time.

throw DtInvalidInput if the time is before the first time.

DtFilePosition MAKLogger::DtLgrPacketIndexer::getPositionOfIndex ( int  index)

Gets the position at the index.

throw DtInvalidInput if the index is invalid.

int MAKLogger::DtLgrPacketIndexer::getSizeOfIndex ( int  index)

Gets the size of the entry at the index.

throw DtInvalidInput if the index is invalid.

double MAKLogger::DtLgrPacketIndexer::getTimeOfIndex ( int  index)

Gets the time of the index.

throw DtInvalidInput if the index is invalid.

int MAKLogger::DtLgrPacketIndexer::lastIndex ( )

Get the last index or -1 if no indices.

Return values:
-1no indices.
void MAKLogger::DtLgrPacketIndexer::removeEntry ( int  index)

Remove an entry.

Warning:
All indexes previously returned may be invalid after this call.

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)