Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef lgrLegacyCheckpointedFormat_H_
00010 #define lgrLegacyCheckpointedFormat_H_
00011
00012 #include "lgrLegacyUncheckpointedFormat.h"
00013 #include <vlutil/vlNetTypes.h>
00014
00015 namespace MAKLogger
00016 {
00017
00018 class DtLgrPacketIndexer;
00019
00024 class DT_DLL_LGRCORE DtLgrLegacyCheckpointedFormat : public DtLgrLegacyUncheckpointedFormat
00025 {
00026 protected:
00027 DtLgrLegacyCheckpointedFormat(DtLoggerFile*);
00028 public:
00029 virtual ~DtLgrLegacyCheckpointedFormat();
00030
00031 private:
00033 DtLgrLegacyCheckpointedFormat(const DtLgrLegacyCheckpointedFormat&);
00035 DtLgrLegacyCheckpointedFormat& operator=(const DtLgrLegacyCheckpointedFormat&);
00036 public:
00037
00038 const static DtNetU32 theEOFMagic;
00039
00041 virtual void copyMetaData(const DtLgrFileFormatter* formatter);
00042
00047 virtual bool seekToFirstPacket(int type);
00048
00053 virtual bool seekToLastPacket(int type);
00054
00058 virtual bool seekToFirstPacketBeforeTime(int type,double time);
00059
00064 virtual bool seekToFirstPacketAfterTime(int type,double time);
00065
00066
00067 using DtLgrLegacyUncheckpointedFormat::seekToNextPacket;
00072 virtual bool seekToNextPacket(int type);
00073
00078 virtual bool seekToPreviousPacket(int type);
00079
00082 virtual void writePacket(const DtPacket& packet);
00083
00090 virtual size_t writePacket(const DtPacket& packet,void* memory,size_t memorySize,
00091 int fileWriteBufferOffset = -1);
00092
00094 virtual bool hasCheckpoints() const;
00095
00097 virtual bool isEofValid() const;
00098
00100 virtual double duration() const;
00101
00103 virtual void setDuration(double duration);
00104
00105 protected:
00106
00109 virtual void initReadEndMetaData();
00110
00112 virtual void readRecordingInfoMetaData();
00113
00115 virtual void decodeRecordingInfoPacket(const DtPacket& packet);
00116
00118 virtual void writeRecordingData();
00119
00121 virtual void readIndexTableMetaData();
00122
00124 virtual void writeIndexTable();
00125
00127 virtual bool checkEofMagic();
00128
00130 virtual void writeEofMagic();
00131
00133 virtual bool jumpToIndex(int index);
00134
00136
00137 virtual DtLgrPacketIndexer* packetIndexer();
00138 virtual const DtLgrPacketIndexer* packetIndexer() const;
00140
00141 protected:
00142
00143 DtLgrPacketIndexer* myPacketIndexer;
00144 double myDuration;
00145 bool myEofMagicIsValid;
00146 bool myEofMagicIsSet;
00147 DtFilePosition myRecordingInfoPosition;
00148 DtFilePosition myIndexTablePosition;
00149 };
00150 }
00151
00152 #endif