|
| void | writePrologue (std::ostream &stream) |
| |
| template<class T > |
| Logfile & | operator<< (Logfile &output, const T &value) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const uint8_t &value) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const uint16_t &value) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const uint32_t &value) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const std::string &value) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const base::Time &time) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const BlockHeader &header) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const SampleHeader &header) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const BlockType &type) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const StreamType &type) |
| |
| template<> |
| Logfile & | operator<< (Logfile &output, const CommandType &type) |
| |
Log files are made of blocks. Each block begins with a common block header. Block are organized in streams, which all begin with a data stream declaration. Data blocks begin with a data stream declaration block, which includes the stream name, the stream type name and (optionally) a type registry which defines the type, in Typelib XML format. If no registry is available, the type registry is of zero size.
All pocosim-defined values are saved in little endian. Only the data payload in data blocks is saved in native endian. The log reader, pocosim-log, is able to swap endianness if needed.
Prologue (12 bytes)
| Offset | Size | Field |
| +0 | 7 | POCOSIM (see Logging::FORMAT_MAGIC) |
| +7 | 4 | Format version (currently 2, see Logging::FORMAT_VERSION) |
| +11 | 1 | Endianness (1 = big, 0 = little) |
Block Header (8 bytes)
| Offset | Size | Field |
| +0 | 1 | block type (Logging::BlockType) |
| +1 | 1 | padding |
| +2 | 2 | stream index |
| +4 | 4 | data size |
Data Stream Declaration Block
| Offset | Size | Field |
| +0 | 1 | Logging::DataStreamType |
| +1 | 4 | stream name size |
| +3 | i | stream name |
| 4 | stream type name size |
| | stream type name |
| 4 | type registry size |
| | type registry |
Sample Block (25 bytes)
| Offset | Size | Field |
| +4 | 4 | real time (sec) |
| +8 | 4 | real time (usec) |
| +20 | 4 | logical time (sec) |
| +24 | 4 | logical time (usec) |
| +32 | 4 | data size |
| +36 | 1 | compression flag |
| +37 | data_size | data |