stateObservation::tools::Logger Class Reference

#include <state-observation/tools/logger.hpp>

Classes

struct  log_s
 

Public Member Functions

 Logger ()
 
virtual ~Logger ()
 
template<typename T >
void record (const T *address, const std::string &filename=std::string(""))
 
template<typename T >
void record (const T &reference, const std::string &filename=std::string(""))
 
template<typename T >
void updateAddress (const void *oldAddress, const T *newAddress)
 updates the address of a recorded variable with a new address More...
 
void setPath (const std::string &path)
 set the Path for the log files, the filenames will be appended to this path More...
 
template<typename T >
void push (const T &reference)
 update the log with a new value of the reference More...
 
template<typename T >
void push (const T *address)
 
void push ()
 updates all the logs for all recorded variables More...
 
const IndexedMatrixArraygetRecord (const void *address) const
 
IndexedMatrixArraygetRecord (const void *address)
 
void save (bool clear=false, bool append=false)
 saves the log in a file More...
 
void clearTracking ()
 clears all the tracking lists and delete all the logs More...
 
void clearLogs ()
 clears the logs but keeps the tracking including time indexation More...
 

Protected Types

typedef std::map< const void *, log_sTmap
 
typedef std::pair< const void *, log_sTpair
 

Protected Member Functions

void update_ (const Tmap::iterator &i)
 

Protected Attributes

std::string path_
 
std::map< const void *, log_slogs_
 
Matrix scalar_
 

Member Typedef Documentation

◆ Tmap

typedef std::map<const void *, log_s> stateObservation::tools::Logger::Tmap
protected

◆ Tpair

typedef std::pair<const void *, log_s> stateObservation::tools::Logger::Tpair
protected

Constructor & Destructor Documentation

◆ Logger()

stateObservation::tools::Logger::Logger ( )

◆ ~Logger()

virtual stateObservation::tools::Logger::~Logger ( )
virtual

Member Function Documentation

◆ clearLogs()

void stateObservation::tools::Logger::clearLogs ( )

clears the logs but keeps the tracking including time indexation

◆ clearTracking()

void stateObservation::tools::Logger::clearTracking ( )

clears all the tracking lists and delete all the logs

◆ getRecord() [1/2]

IndexedMatrixArray& stateObservation::tools::Logger::getRecord ( const void *  address)

◆ getRecord() [2/2]

const IndexedMatrixArray& stateObservation::tools::Logger::getRecord ( const void *  address) const

◆ push() [1/3]

void stateObservation::tools::Logger::push ( )

updates all the logs for all recorded variables

◆ push() [2/3]

template<typename T >
void stateObservation::tools::Logger::push ( const T &  reference)

update the log with a new value of the reference

◆ push() [3/3]

template<typename T >
void stateObservation::tools::Logger::push ( const T *  address)

◆ record() [1/2]

template<typename T >
void stateObservation::tools::Logger::record ( const T &  reference,
const std::string &  filename = std::string("") 
)

◆ record() [2/2]

template<typename T >
void stateObservation::tools::Logger::record ( const T *  address,
const std::string &  filename = std::string("") 
)

Use this function to start the recoding of this variable. WARNING: Be sure that the recorded variable keeps the same memory address otherwise use updateAddress

◆ save()

void stateObservation::tools::Logger::save ( bool  clear = false,
bool  append = false 
)

saves the log in a file

◆ setPath()

void stateObservation::tools::Logger::setPath ( const std::string &  path)

set the Path for the log files, the filenames will be appended to this path

◆ update_()

void stateObservation::tools::Logger::update_ ( const Tmap::iterator &  i)
protected

◆ updateAddress()

template<typename T >
void stateObservation::tools::Logger::updateAddress ( const void *  oldAddress,
const T *  newAddress 
)

updates the address of a recorded variable with a new address

Member Data Documentation

◆ logs_

std::map<const void *, log_s> stateObservation::tools::Logger::logs_
protected

◆ path_

std::string stateObservation::tools::Logger::path_
protected

◆ scalar_

Matrix stateObservation::tools::Logger::scalar_
protected

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