mc_rtc::log::FlatLog Struct Reference

#include <mc_rtc/log/FlatLog.h>

Classes

struct  entry
 
struct  record
 

Public Types

template<typename T >
using get_raw_return_t = typename details::GetRawReturnType< T >::type
 

Public Member Functions

 FlatLog ()=default
 
 FlatLog (const std::string &fpath)
 
 FlatLog (const FlatLog &)=delete
 
FlatLogoperator= (const FlatLog &)=delete
 
 FlatLog (FlatLog &&)=default
 
FlatLogoperator= (FlatLog &&)=default
 
void load (const std::string &fpath)
 
void append (const std::string &fpath)
 
size_t size () const
 
std::set< std::string > entries () const
 
bool has (const std::string &entry) const
 
std::set< LogTypetypes (const std::string &entry) const
 
LogType type (const std::string &entry) const
 
LogType type (const std::string &entry, size_t i) const
 
template<typename T >
std::vector< const get_raw_return_t< T > * > getRaw (const std::string &entry) const
 
template<typename T >
std::vector< get_raw_return_t< T > > get (const std::string &entry, const T &def) const
 
template<typename T >
std::vector< get_raw_return_t< T > > get (const std::string &entry) const
 
template<typename T >
get_raw_return_t< T > get (const std::string &entry, size_t i, const T &def) const
 
template<typename T >
const get_raw_return_t< T > * getRaw (const std::string &entry, size_t i) const
 
const std::vector< std::vector< Logger::GUIEvent > > & guiEvents () const noexcept
 
const std::optional< Logger::Meta > & meta () const noexcept
 

Detailed Description

From an on-disk binary log recorded by mc_rtc, return a flat structure

Member Typedef Documentation

◆ get_raw_return_t

template<typename T >
using mc_rtc::log::FlatLog::get_raw_return_t = typename details::GetRawReturnType<T>::type

Constructor & Destructor Documentation

◆ FlatLog() [1/4]

mc_rtc::log::FlatLog::FlatLog ( )
default

Default constructor, empty log

◆ FlatLog() [2/4]

mc_rtc::log::FlatLog::FlatLog ( const std::string &  fpath)

Load a file into the log

◆ FlatLog() [3/4]

mc_rtc::log::FlatLog::FlatLog ( const FlatLog )
delete

◆ FlatLog() [4/4]

mc_rtc::log::FlatLog::FlatLog ( FlatLog &&  )
default

Member Function Documentation

◆ append()

void mc_rtc::log::FlatLog::append ( const std::string &  fpath)

Append a file into the flat log, the resulting content is the concatenation of the two logs

◆ entries()

std::set<std::string> mc_rtc::log::FlatLog::entries ( ) const

Returns a sorted list of entries in the log

◆ get() [1/3]

template<typename T >
std::vector<get_raw_return_t<T> > mc_rtc::log::FlatLog::get ( const std::string &  entry) const

Get a typed record entry

When the record data type does not match the requested data type, the vector is automatically filled up with the last (or first if relevant) recorded data

Parameters
entryEntry to get

◆ get() [2/3]

template<typename T >
std::vector<get_raw_return_t<T> > mc_rtc::log::FlatLog::get ( const std::string &  entry,
const T &  def 
) const

Get a typed record entry

Get a default value when the record data type does not match the requested data type

Parameters
entryEntry to get
defDefault value when the record data does not match requested data

◆ get() [3/3]

template<typename T >
get_raw_return_t<T> mc_rtc::log::FlatLog::get ( const std::string &  entry,
size_t  i,
const T &  def 
) const

Get a typed record entry at a given index

When the record type does not match the requested data type, returns the default value provided.

Parameters
entryEntry to get
iIndex to get
defDefault value when the record data does not match requested data

◆ getRaw() [1/2]

template<typename T >
std::vector<const get_raw_return_t<T> *> mc_rtc::log::FlatLog::getRaw ( const std::string &  entry) const

Get a type record entry.

Get null pointer entry when the record data type does not match the requested data type

Parameters
entryEntry to get

◆ getRaw() [2/2]

template<typename T >
const get_raw_return_t<T>* mc_rtc::log::FlatLog::getRaw ( const std::string &  entry,
size_t  i 
) const

Get a typed raw entry at a given index

Returns nullptr when the requested type does not match the record type

Parameters
entryEntry to get
iIndex to get

◆ guiEvents()

const std::vector<std::vector<Logger::GUIEvent> >& mc_rtc::log::FlatLog::guiEvents ( ) const
inlinenoexcept

Returns all the GUI events that happened during the log recording

◆ has()

bool mc_rtc::log::FlatLog::has ( const std::string &  entry) const

Returns true if the log has the provided entry

◆ load()

void mc_rtc::log::FlatLog::load ( const std::string &  fpath)

Load a file into the log, erase the current content of the flat log

◆ meta()

const std::optional<Logger::Meta>& mc_rtc::log::FlatLog::meta ( ) const
inlinenoexcept

Returns the meta information contained in the log

nullopt when the file does not contain such information

◆ operator=() [1/2]

FlatLog& mc_rtc::log::FlatLog::operator= ( const FlatLog )
delete

◆ operator=() [2/2]

FlatLog& mc_rtc::log::FlatLog::operator= ( FlatLog &&  )
default

◆ size()

size_t mc_rtc::log::FlatLog::size ( ) const

Returns the size of the log

◆ type() [1/2]

LogType mc_rtc::log::FlatLog::type ( const std::string &  entry) const

Get the first non None type for an entry

◆ type() [2/2]

LogType mc_rtc::log::FlatLog::type ( const std::string &  entry,
size_t  i 
) const

Get the type at index i

◆ types()

std::set<LogType> mc_rtc::log::FlatLog::types ( const std::string &  entry) const

Returns available types for an entry


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