![]() |
MAK Data Logger API Documentation for DIS
|
An abstract logger file formatter. More...
Inheritance diagram for MAKLogger::DtLgrFileFormatter:
Collaboration diagram for MAKLogger::DtLgrFileFormatter:Public Member Functions | |
| virtual | ~DtLgrFileFormatter () |
| DTOR. More... | |
| virtual void | setSerialMode (bool enable) |
| Get whether the formatter is in serial mode. More... | |
| virtual bool | serialMode () const |
| Get whether the formatter is in serial mode. More... | |
| virtual void | copyMetaData (const DtLgrFileFormatter *formatter) |
| Copy the meta data from the given formatter. More... | |
| virtual DtLgrEntityTracker * | entityTracker () const |
| Get the formatter's entity tracker, or null if it does not have one. More... | |
| virtual void | setTimeLimit (double limit) |
| Set the time limit on reads during playback. More... | |
| virtual DtLoggerFile * | loggerFile () |
| Get the logger file the formatter is operating on. More... | |
| virtual const DtLoggerFile * | loggerFile () const |
| Get the logger file the formatter is operating on. More... | |
| DtLoggerFileMetaData * | metaData () |
| Get the meta data for the file. More... | |
| const DtLoggerFileMetaData * | metaData () const |
| Get the meta data for the file. More... | |
Abstract File Formatter interface. | |
| virtual void | initializeSerialMode (DtFilePosition firstPacket=0, DtFilePosition lastPacket=0, bool skipCheckpointRead=false)=0 |
| Initialize serial mode, this function must be called once to properly set the first and last serial packets. More... | |
| virtual bool | isEofValid () const =0 |
| Returns whether EOF is valid. More... | |
| virtual bool | hasLastPacket () const =0 |
| Returns whether the file has set its last packet. More... | |
| virtual bool | recoverLastPacket ()=0 |
| Recover the last packet by seeking from the beginning of the file Return - Last packet found? More... | |
| virtual double | firstPacketTime () const =0 |
| The time of the first packet. More... | |
| virtual size_t | firstPacketSize () const =0 |
| The size of the first packet. More... | |
| virtual double | lastPacketTime () const =0 |
| The time of the last packet. More... | |
| virtual size_t | lastPacketSize () const =0 |
| The size of the last packet. More... | |
| virtual bool | atEndOfFile ()=0 |
| Check to see if after all packets. More... | |
| virtual bool | seekToFirstPacket ()=0 |
| Seek to first packet in the file. More... | |
| virtual bool | seekToFirstPacket (int type)=0 |
| Seek to first packet of a given type in the file. More... | |
| virtual bool | seekToLastPacket ()=0 |
| Seek to the last packet in the file. More... | |
| virtual bool | seekToLastPacket (int type)=0 |
| Seek to the last packet of a given type in the file. More... | |
| virtual bool | seekToFirstPacketBeforeTime (double time)=0 |
| Seek to the first packet before the given time. More... | |
| virtual bool | seekToFirstPacketBeforeTime (int type, double time)=0 |
| Seek to the first packet of a given type before the given time. More... | |
| virtual bool | seekToFirstPacketAfterTime (double time)=0 |
| Seek to the first packet after the given time. More... | |
| virtual bool | seekToFirstPacketAfterTime (int type, double time)=0 |
| Seek to the first packet of a given type after the given time. More... | |
| virtual bool | seekToNextSerialPacket ()=0 |
| Seek to the next serial packet. More... | |
| virtual bool | seekToNextPacket ()=0 |
| Seek to the next packet. More... | |
| virtual bool | seekToNextPacket (int type)=0 |
| Seek to the next packet of a given type. More... | |
| virtual bool | seekToPreviousPacket ()=0 |
| Seek to the previous packet. More... | |
| virtual bool | seekToPreviousPacketOfType (int type)=0 |
| Seek to the previous packet of a given type. More... | |
| virtual void | seekToPosition (DtFilePosition)=0 |
| Seek to a specific position. More... | |
| virtual double | currentPacketTime ()=0 |
| Get the current packet time. More... | |
| virtual int | currentPacketType ()=0 |
| Get the current packet type. More... | |
| virtual size_t | currentPacketSize ()=0 |
| Get the current packet size. More... | |
| virtual DtFilePosition | currentPosition ()=0 |
| Get the current file position. More... | |
| virtual bool | hasCheckpoints () const =0 |
| Get whether the format supports checkpoints. More... | |
| virtual void | readMetaData ()=0 |
| Read the metadata from the file. More... | |
| virtual void | readMetaData (DtLoggerFileMetaData::DataPosition position)=0 |
| Reads the specified meta data from the file. More... | |
| virtual void | writeMetaData (DtLoggerFileMetaData::DataPosition position)=0 |
| Writes meta data at a specific position in the file. More... | |
| virtual void | readPacketsUptoCount (DtMessageBuffer &, DtMemoryBufferSP, int packetCount)=0 |
| Read the given number of packets or up to the size of the smart buffer which ever comes first. More... | |
| virtual void | readPacketsUptoSize (DtMessageBuffer &, DtMemoryBufferSP)=0 |
| Read packets to fill the smart buffer. More... | |
| virtual double | readPacketsUpToTime (DtMessageBuffer &, DtMemoryBufferSP, double time, bool inclusive=true)=0 |
| Read all packets up to a time or up to the size of the smart buffer which ever comes first. More... | |
| virtual void | writePackets (const DtMessageBuffer &)=0 |
| Write all the packets into the end of the file. More... | |
| virtual void | writePacket (const DtPacket &packet)=0 |
| Write a single packet to the file. More... | |
| virtual size_t | writePacket (const DtPacket &, void *memory, size_t memorySize, int fileWriteBufferOffset=-1)=0 |
| Write a packet into the provided memory. More... | |
| virtual void | setDuration (double duration)=0 |
| Set the duration. More... | |
| virtual void | setStartEndTimes (double start, double end)=0 |
| Set the start and end times (first and last packet). More... | |
| virtual double | duration () const =0 |
| Get the current duration of the file. More... | |
| virtual void | setDescription (DtString description)=0 |
| Set the duration. More... | |
| virtual DtString | description () const =0 |
| Get the current description of the file. More... | |
| virtual size_t | headerSize () const =0 |
| Returns size in bytes of a packet header. More... | |
| virtual size_t | tailSize () const =0 |
| Returns size in bytes of a packet tail. More... | |
Protected Member Functions | |
| DtLgrFileFormatter (DtLoggerFile *) | |
| CTOR which stores a copy of the file to operate on. More... | |
Protected Attributes | |
| DtLoggerFile * | myLoggerFile |
| DtLoggerFileMetaData * | myLoggerMetaData |
| bool | mySerialMode |
| double | myReadTimeLimit |
Private Member Functions | |
| DtLgrFileFormatter (const DtLgrFileFormatter &) | |
| Not Implemented. More... | |
| DtLgrFileFormatter & | operator= (const DtLgrFileFormatter &) |
| Not Implemented. More... | |
An abstract logger file formatter.
The DtLgrFileFormatter is responsible for defining the interface which various Logger File formats can be written against. The implementations are registered with the DtLgrFileFormatProvider which is used to create the necessary formatter.
|
protected |
CTOR which stores a copy of the file to operate on.
This constructor is protected as it will be implemented by a sub class, via a static construct. This static constructor should be registered with the file version with the DtLgrFileFormaProvider which creates formatters.
|
virtual |
DTOR.
|
private |
Not Implemented.
|
pure virtual |
Check to see if after all packets.
If at the end of file add further reads will fail. Writes however will succeed as the end of the file will be extended. The end of the file differs from the last packet position. A seek to the last packet and a read of 1 packet will result at being at the end of the file.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
virtual |
Copy the meta data from the given formatter.
Reimplemented in MAKLogger::DtLgrLegacyCheckpointedFormat, MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrEntityTrackingFormat.
|
pure virtual |
Get the current packet size.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrGenericFileFormat.
|
pure virtual |
Get the current packet time.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrGenericFileFormat.
|
pure virtual |
Get the current packet type.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrGenericFileFormat.
|
pure virtual |
Get the current file position.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Get the current description of the file.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, MAKLogger::DtLgrDis5_3Format, and MAKLogger::DtLgrGenericFileFormat.
|
pure virtual |
Get the current duration of the file.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
virtual |
Get the formatter's entity tracker, or null if it does not have one.
Reimplemented in MAKLogger::DtLgrDis4_3Format, MAKLogger::DtLgrEntityTrackingFormat, and MAKLogger::DtLgrGenericFileFormat.
|
pure virtual |
The size of the first packet.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
The time of the first packet.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Get whether the format supports checkpoints.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
pure virtual |
Returns whether the file has set its last packet.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Returns size in bytes of a packet header.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, MAKLogger::DtLgrGenericFileFormat, and MAKLogger::DtLgrEntityTrackingFormat.
|
pure virtual |
Initialize serial mode, this function must be called once to properly set the first and last serial packets.
The optional parameters should not be used unless required to set the range of the file.
| Input | |
| firstPacket | the absolute position of the first serial packet. |
| lastPacket | the absolute position of the last serial packet. |
| skipCheckpointRead | skip reading checkpoints for incomplete file (i.e., if not needed) |
| DtInvalidLoggerFile | If it is unable to set the first and last serial packets. |
Implemented in MAKLogger::DtLgrLegacyCheckpointedFormat, and MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Returns whether EOF is valid.
Implemented in MAKLogger::DtLgrLegacyCheckpointedFormat, and MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
The size of the last packet.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
The time of the last packet.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
virtual |
Get the logger file the formatter is operating on.
|
virtual |
Get the logger file the formatter is operating on.
| DtLoggerFileMetaData* MAKLogger::DtLgrFileFormatter::metaData | ( | ) |
Get the meta data for the file.
| const DtLoggerFileMetaData* MAKLogger::DtLgrFileFormatter::metaData | ( | ) | const |
Get the meta data for the file.
|
private |
Not Implemented.
|
pure virtual |
Read the metadata from the file.
Reading the metadata initializes the first and last markers for reading normal serial packets and it should be performed before reading normal packets.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Reads the specified meta data from the file.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Read the given number of packets or up to the size of the smart buffer which ever comes first.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Read packets to fill the smart buffer.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Read all packets up to a time or up to the size of the smart buffer which ever comes first.
Optionally inclusive or exclusive of the last time. Return the next packet time if known and all packets up to the time have been read; otherwise, -1.0
| DtFileReadError | file read error. |
| DtInvalidInput | invalid time input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Recover the last packet by seeking from the beginning of the file Return - Last packet found?
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to first packet in the file.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to first packet of a given type in the file.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
pure virtual |
Seek to the first packet after the given time.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid time input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to the first packet of a given type after the given time.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type or time input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
pure virtual |
Seek to the first packet before the given time.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid time input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to the first packet of a given type before the given time.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
pure virtual |
Seek to the last packet in the file.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to the last packet of a given type in the file.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
pure virtual |
Seek to the next packet.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to the next packet of a given type.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
pure virtual |
Seek to the next serial packet.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to a specific position.
This function is dangerous as it can seek to an improper position.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to the previous packet.
| DtFileReadError | file read error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Seek to the previous packet of a given type.
| DtFileReadError | file read error. |
| DtInvalidInput | invalid type input. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
virtual |
Get whether the formatter is in serial mode.
|
pure virtual |
Set the duration.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, MAKLogger::DtLgrDis5_3Format, and MAKLogger::DtLgrGenericFileFormat.
|
pure virtual |
Set the duration.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrLegacyCheckpointedFormat.
|
virtual |
Get whether the formatter is in serial mode.
In serial mode the reads respect the first and last tape positions. Also writes will fail unless in serial mode.
|
pure virtual |
Set the start and end times (first and last packet).
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, and MAKLogger::DtLgrEntityTrackingFormat.
|
virtual |
Set the time limit on reads during playback.
Units are seconds. A value less than zero indicates no limit.
|
pure virtual |
Returns size in bytes of a packet tail.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Writes meta data at a specific position in the file.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
pure virtual |
Write a single packet to the file.
Override this function to change how packets are written to the file.
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, MAKLogger::DtLgrLegacyCheckpointedFormat, and MAKLogger::DtLgrEntityTrackingFormat.
|
pure virtual |
Write a packet into the provided memory.
| Input | |
| fileWriteBufferOffset,certain | packets such as checkpoints require the position in the file where it will be written to. In cases where the memory written is for a write buffer (which once full will be written to a file) the fileWriteBufferOffset can be used to calculate it's position in the file. |
| DtInvalidInput | if memorySize is insufficient or memory is null. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat, MAKLogger::DtLgrLegacyCheckpointedFormat, and MAKLogger::DtLgrEntityTrackingFormat.
|
pure virtual |
Write all the packets into the end of the file.
| DtFileWriteError | file write error. |
Implemented in MAKLogger::DtLgrLegacyUncheckpointedFormat.
|
protected |
|
protected |
|
protected |
|
protected |