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

Logger file writer class. More...

+ Inheritance diagram for MAKLogger::DtLoggerFileWriter:
+ Collaboration diagram for MAKLogger::DtLoggerFileWriter:

Public Member Functions

virtual ~DtLoggerFileWriter ()
 
virtual void setDuration (const DtRelativeTime &duration)
 Artificially set the duration of a tape. More...
 
virtual void setStartEndTimes (const double start, const double end)
 Set the start and end times for writing to the output. More...
 
virtual void setDescription (const DtString &description)
 Set the description to be written to the output. More...
 
virtual const DtRelativeTimeduration () const
 Get the current duration of the file written. More...
 
virtual const double startTime () const
 Get the start time as the time of the first data packet. More...
 
virtual const double endTime () const
 Get the end time as the time of the last data packet. More...
 
virtual void setWriteBufferSize (size_t)
 Set the read buffer size. More...
 
virtual size_t getWriteBufferSize () const
 Get the read buffer size. More...
 
virtual void activate (const DtMessageInput *fileInput)
 Activate the writer. More...
 
virtual bool isActivated () const
 Get if the output has been activated. More...
 
virtual void deactivate ()
 Deactivate the writer. More...
 
virtual const DtMessageIOInfoinfo () const
 Get the Info. More...
 
virtual const DtStringfilename () const
 Get the current file name. More...
 
virtual DtFilePosition fileSize () const
 Get the current file size. More...
 
virtual DtFilePosition currentPosition () const
 Get the current file position. More...
 
virtual void flush ()
 Flush output, called after all outputs are finish for a time step. More...
 
virtual void setOutputScaling (double scaling, bool enableStatic, bool isPaused=false)
 Set an output scaling value and static indicator. More...
 
const DtLoggerRecordFileloggerRecordFile () const
 Get the file the writer is writing to. More...
 
- Public Member Functions inherited from MAKLogger::DtLgrFileOutput
virtual ~DtLgrFileOutput ()
 DTOR. More...
 
virtual bool outputPacket (const DtPacket &buffer)
 Output a packet. More...
 
virtual void filterMessage (DtPacket *packet)
 Filter the message, no-op. More...
 
virtual int lastMessageType () const
 Get the type of the last message outputted. More...
 
virtual size_t lastMessageSize () const
 Get the size of the last message outputted. More...
 
virtual DtAbsoluteTime lastMessageTime () const
 Get the time of the last message outputted. More...
 
virtual DtAbsoluteTime firstMessageTime () const
 Get the time of the first message outputted. More...
 
- Public Member Functions inherited from MAKLogger::DtMessageOutput
 DtMessageOutput ()
 CTOR. More...
 
virtual ~DtMessageOutput ()
 DTOR. More...
 
virtual bool sourceTimeInclusive () const
 Get the whether input time was inclusive. More...
 
virtual void outputMessages (const DtMessageBuffer &buffer)
 Apply filter flags to message buffer. More...
 
virtual void outputMessage (const DtPacket *packet)
 Output a single message. More...
 
virtual void filterMessages (DtMessageBuffer &buffer)
 Apply filter flags to message buffer. More...
 
virtual void filterMessageAllowingCheckpoints (DtPacket *packet)
 Apply filter to a packet, allowing checkpoints. More...
 
virtual void setSendImmediate (bool enable)
 Turn on and off sending immediate messages. More...
 
virtual void setSendRetained (bool enable)
 Turn on and off sending retained messages. More...
 
virtual void setSendInitial (bool enable)
 Turn on and off sending initial state messages. More...
 
void attachFilter (DtMessageFilter *)
 Attach a filter to the output. More...
 
void detachFilter (DtMessageFilter *)
 Detach a filter from the output. More...
 
void filters (DtCollector< DtMessageFilter * > filterCollection) const
 Return the filters associated with the output. More...
 
DtObserveEvent< DtPacket > * preOutputPacketEvent ()
 Get the event signaled before a packet is output. More...
 
DtObserveEvent< DtPacket > * postOutputPacketEvent ()
 Get the event signaled after a packet is output. More...
 
DtObserveEvent< DtPacket > * packetFilteredEvent ()
 Get the event signaled if a packet is filtered. More...
 
virtual void setSourceTime (const DtAbsoluteTime &sourceTime, bool inclusive)
 Set/Get the time boundary used to collect the the source to be processed for output. More...
 
virtual DtAbsoluteTime sourceTime () const
 Set/Get the time boundary used to collect the the source to be processed for output. More...
 

Static Public Attributes

static const DtU32 PostDataMagic = 0xCFB91181
 End of file data. More...
 

Protected Member Functions

virtual bool writePacket (const DtPacket &packet)
 Write a packet. More...
 
DtString multiFileDescription (bool final)
 Construct the description used when saving multiple files. More...
 
- Protected Member Functions inherited from MAKLogger::DtLgrFileOutput
 DtLgrFileOutput ()
 Intentionally protected constructor. More...
 

Protected Attributes

DtMessageIOInfomyMessageInfo
 
DtLoggerRecordFilemyRecordFile
 
size_t myBufferSize
 
DtMemoryBufferSP myMemory
 
DtSmartBuffer myCurrentMemory
 
bool myActivatedFlag
 
DtRelativeTime myDuration
 
- Protected Attributes inherited from MAKLogger::DtLgrFileOutput
DtAbsoluteTime myFirstTime
 
DtAbsoluteTime myLastTime
 
int myLastPacketType
 
size_t myLastPacketSize
 
- Protected Attributes inherited from MAKLogger::DtMessageOutput
std::set< DtMessageFilter * > myFilters
 
DtObserveEvent< DtPacketmyPreOutputPacketEvent
 Event called before a packet is output. More...
 
DtObserveEvent< DtPacketmyPostOutputPacketEvent
 Event called after a packet is output. More...
 
DtObserveEvent< DtPacketmyFilteredPacketEvent
 Event called if a packet is filtered. More...
 
bool mySendImmediateFlag
 Whether to send immediate messages. More...
 
bool mySendRetainedFlag
 Whether to send retained messages. More...
 
bool mySendInitialFlag
 Whether to send initial state messages. More...
 
DtAbsoluteTime mySourceTime
 The time used for collecting input. More...
 
bool mySourceTimeBoundary
 Whether the input time was inclusive or exclusive. More...
 

Private Member Functions

 DtLoggerFileWriter (const DtLoggerFileWriter &)
 Not Implemented. More...
 
DtLoggerFileWriteroperator= (const DtLoggerFileWriter &)
 Not Implemented. More...
 

Detailed Description

Logger file writer class.

Constructor & Destructor Documentation

virtual MAKLogger::DtLoggerFileWriter::~DtLoggerFileWriter ( )
virtual
MAKLogger::DtLoggerFileWriter::DtLoggerFileWriter ( const DtLoggerFileWriter )
private

Not Implemented.

Member Function Documentation

virtual void MAKLogger::DtLoggerFileWriter::activate ( const DtMessageInput fileInput)
virtual

Activate the writer.

This needs to be called before writing any data to the file.

Implements MAKLogger::DtMessageOutput.

virtual DtFilePosition MAKLogger::DtLoggerFileWriter::currentPosition ( ) const
virtual

Get the current file position.

This may not be accurate if the data is buffered. Call flush to ensure this is accurate. For performance reasons you may not wish to flush frequently.

Implements MAKLogger::DtLgrFileOutput.

virtual void MAKLogger::DtLoggerFileWriter::deactivate ( )
virtual

Deactivate the writer.

Implements MAKLogger::DtMessageOutput.

virtual const DtRelativeTime& MAKLogger::DtLoggerFileWriter::duration ( ) const
virtual

Get the current duration of the file written.

virtual const double MAKLogger::DtLoggerFileWriter::endTime ( ) const
virtual

Get the end time as the time of the last data packet.

virtual const DtString& MAKLogger::DtLoggerFileWriter::filename ( ) const
virtual

Get the current file name.

Implements MAKLogger::DtLgrFileOutput.

virtual DtFilePosition MAKLogger::DtLoggerFileWriter::fileSize ( ) const
virtual

Get the current file size.

This may not be accurate if the data is buffered. Call flush to ensure this is accurate. For performance reasons you may not wish to flush frequently.

Implements MAKLogger::DtLgrFileOutput.

virtual void MAKLogger::DtLoggerFileWriter::flush ( )
virtual

Flush output, called after all outputs are finish for a time step.

Implements MAKLogger::DtMessageOutput.

virtual size_t MAKLogger::DtLoggerFileWriter::getWriteBufferSize ( ) const
virtual

Get the read buffer size.

Implements MAKLogger::DtLgrFileOutput.

virtual const DtMessageIOInfo* MAKLogger::DtLoggerFileWriter::info ( ) const
virtual

Get the Info.

Implements MAKLogger::DtMessageOutput.

virtual bool MAKLogger::DtLoggerFileWriter::isActivated ( ) const
virtual

Get if the output has been activated.

Implements MAKLogger::DtMessageOutput.

const DtLoggerRecordFile* MAKLogger::DtLoggerFileWriter::loggerRecordFile ( ) const

Get the file the writer is writing to.

DtString MAKLogger::DtLoggerFileWriter::multiFileDescription ( bool  final)
protected

Construct the description used when saving multiple files.

This is the description preceded by parent filename and other recording information. Passing final = true resets the last start time used in the description header back to 0.0.

DtLoggerFileWriter& MAKLogger::DtLoggerFileWriter::operator= ( const DtLoggerFileWriter )
private

Not Implemented.

virtual void MAKLogger::DtLoggerFileWriter::setDescription ( const DtString description)
virtual

Set the description to be written to the output.

Implements MAKLogger::DtLgrFileOutput.

virtual void MAKLogger::DtLoggerFileWriter::setDuration ( const DtRelativeTime duration)
virtual

Artificially set the duration of a tape.

This may be changed if a packet is written which occurs after the tame.

Implements MAKLogger::DtLgrFileOutput.

virtual void MAKLogger::DtLoggerFileWriter::setOutputScaling ( double  scaling,
bool  enableStatic,
bool  isPaused = false 
)
virtual

Set an output scaling value and static indicator.

Implements MAKLogger::DtMessageOutput.

virtual void MAKLogger::DtLoggerFileWriter::setStartEndTimes ( const double  start,
const double  end 
)
virtual

Set the start and end times for writing to the output.

Implements MAKLogger::DtLgrFileOutput.

virtual void MAKLogger::DtLoggerFileWriter::setWriteBufferSize ( size_t  )
virtual

Set the read buffer size.

Implements MAKLogger::DtLgrFileOutput.

virtual const double MAKLogger::DtLoggerFileWriter::startTime ( ) const
virtual

Get the start time as the time of the first data packet.

virtual bool MAKLogger::DtLoggerFileWriter::writePacket ( const DtPacket packet)
protectedvirtual

Write a packet.

Implements MAKLogger::DtLgrFileOutput.

Member Data Documentation

bool MAKLogger::DtLoggerFileWriter::myActivatedFlag
protected
size_t MAKLogger::DtLoggerFileWriter::myBufferSize
protected
DtSmartBuffer MAKLogger::DtLoggerFileWriter::myCurrentMemory
protected
DtRelativeTime MAKLogger::DtLoggerFileWriter::myDuration
protected
DtMemoryBufferSP MAKLogger::DtLoggerFileWriter::myMemory
protected
DtMessageIOInfo* MAKLogger::DtLoggerFileWriter::myMessageInfo
protected
DtLoggerRecordFile* MAKLogger::DtLoggerFileWriter::myRecordFile
protected
const DtU32 MAKLogger::DtLoggerFileWriter::PostDataMagic = 0xCFB91181
static

End of file data.


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

Document ID: Generated on Mon Mar 22 15:30:17 EDT 2021 from SVN revision 226440
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)