pocolog_cpp
Namespaces | Classes | Enumerations | Functions | Variables
pocolog_cpp Namespace Reference

Namespaces

 details
 

Classes

class  BadBlockType
 
struct  BadDataSize
 
struct  BadMagic
 
class  BadStream
 
struct  BadStreamType
 
struct  BlockHeader
 
struct  buffer_reader
 
class  ControlStream
 
class  DataBlockException
 
class  DataInputIterator
 
struct  DataSizeMismatch
 
class  DataStream
 
class  FileException
 
class  FileStream
 
class  Index
 
class  IndexFile
 
class  Input
 
class  InputDataStream
 
class  LogFile
 
class  MultiFileIndex
 
struct  NoSuchStream
 
class  Output
 
struct  Prologue
 
struct  SampleHeader
 
struct  SampleHeaderData
 
class  Stream
 
class  StreamDescription
 
struct  StreamMetadata
 
class  StreamWriter
 
struct  Truncated
 

Enumerations

enum  BlockType { UnknownBlockType = 0, StreamBlockType = 1, DataBlockType = 2, ControlBlockType = 3 }
 
enum  StreamType { UnknownStreamType = 0, DataStreamType = 1, ControlStreamType = 2 }
 
enum  CommandType { SetTimeBase = 0, SetTimeOffset = 1 }
 

Functions

struct pocolog_cpp::Prologue __attribute__ ((packed))
 
void writePrologue (std::ostream &stream)
 
template<class T >
Outputoperator<< (Output &output, const T &value)
 
template<>
Outputoperator<< (Output &output, const uint8_t &value)
 
template<>
Outputoperator<< (Output &output, const uint16_t &value)
 
template<>
Outputoperator<< (Output &output, const uint32_t &value)
 
template<>
Outputoperator<< (Output &output, const std::string &value)
 
template<>
Outputoperator<< (Output &output, const base::Time &time)
 
template<>
Outputoperator<< (Output &output, const BlockHeader &header)
 
template<>
Outputoperator<< (Output &output, const SampleHeader &header)
 
template<>
Outputoperator<< (Output &output, const BlockType &type)
 
template<>
Outputoperator<< (Output &output, const StreamType &type)
 
template<>
Outputoperator<< (Output &output, const CommandType &type)
 

Variables

const char FORMAT_MAGIC [] = "POCOSIM"
 
struct pocolog_cpp::SampleHeader __attribute__
 

Detailed Description

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)
OffsetSizeField
+07POCOSIM (see Logging::FORMAT_MAGIC)
+74Format version (currently 2, see Logging::FORMAT_VERSION)
+111Endianness (1 = big, 0 = little)
Block Header (8 bytes)
OffsetSizeField
+01block type (Logging::BlockType)
+11padding
+22stream index
+44data size
Control Stream Declaration Block
OffsetSizeField
+0 1Logging::ControlStreamType
Data Stream Declaration Block
OffsetSizeField
+0 1Logging::DataStreamType
+1 4stream name size
+3 istream name
4stream type name size
stream type name
4type registry size
type registry
Sample Block (25 bytes)
OffsetSizeField
+4 4real time (sec)
+8 4real time (usec)
+204logical time (sec)
+244logical time (usec)
+324data size
+361compression flag
+37data_sizedata

Enumeration Type Documentation

Enumerator
UnknownBlockType 
StreamBlockType 
DataBlockType 

stream declaration block

ControlBlockType 

a data block in an already declared stream

Enumerator
SetTimeBase 
SetTimeOffset 
Enumerator
UnknownStreamType 
DataStreamType 
ControlStreamType 

Function Documentation

struct pocolog_cpp::Prologue pocolog_cpp::__attribute__ ( (packed)  )
template<class T >
Output& pocolog_cpp::operator<< ( Output output,
const T &  value 
)
template<>
Output& pocolog_cpp::operator<< ( Output output,
const uint8_t &  value 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const uint16_t &  value 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const uint32_t &  value 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const std::string &  value 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const base::Time &  time 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const BlockHeader header 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const SampleHeader header 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const BlockType type 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const StreamType type 
)
inline
template<>
Output& pocolog_cpp::operator<< ( Output output,
const CommandType type 
)
inline
void pocolog_cpp::writePrologue ( std::ostream &  stream)

Writes the file prologue

Variable Documentation

pocolog_cpp::InputDataStream pocolog_cpp::__attribute__
const char pocolog_cpp::FORMAT_MAGIC = "POCOSIM"