pocolog_cpp
Public Member Functions | List of all members
pocolog_cpp::StreamWriter Class Reference

#include <Write.hpp>

Public Member Functions

 StreamWriter (std::string const &name, std::string const &type_name, std::vector< StreamMetadata > const &metadata, Output &file)
 
 StreamWriter (std::string const &name, std::string const &type_name, Typelib::Registry const &type_def, std::vector< StreamMetadata > const &metadata, Output &file)
 
void registerStream ()
 
void setSampling (base::Time const &period)
 
bool writeSampleHeader (const base::Time &timestamp, uint32_t payload_size)
 
std::ostream & getStream ()
 

Detailed Description

The objects of this class can be used to easily log samples for a given stream.

Constructor & Destructor Documentation

◆ StreamWriter() [1/2]

pocolog_cpp::StreamWriter::StreamWriter ( std::string const &  name,
std::string const &  type_name,
std::vector< StreamMetadata > const &  metadata,
Output file 
)

Create a new logger, with no type definition

This logger will define a new named stream in stream, but without saving the type definition as the other constructor would.

  • name the stream name
  • type_name the stream type name
  • stream the stream object

◆ StreamWriter() [2/2]

pocolog_cpp::StreamWriter::StreamWriter ( std::string const &  name,
std::string const &  type_name,
Typelib::Registry const &  type_def,
std::vector< StreamMetadata > const &  metadata,
Output file 
)

Create a new logger, with type definition

This logger will define a new named stream in stream, in which a type definition string is saved, allowing to re-read the log file without having to care about the type definition and (possible) type changes.

  • name the stream name
  • type_name the stream type name
  • registry the Typelib registry which defines the associated type name
  • stream the stream object

Member Function Documentation

◆ getStream()

std::ostream & pocolog_cpp::StreamWriter::getStream ( )

◆ registerStream()

void pocolog_cpp::StreamWriter::registerStream ( )

Registers the sample stream in the output file

◆ setSampling()

void pocolog_cpp::StreamWriter::setSampling ( base::Time const &  period)

Sets the sampling period. It is used in update() to filter out samples that are too near from each other

◆ writeSampleHeader()

bool pocolog_cpp::StreamWriter::writeSampleHeader ( const base::Time &  timestamp,
uint32_t  payload_size 
)

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