#include <src/Logger.h>
Inheritance diagram for Logger:
Enough for our current needs, something more sophisticated may be necessary in the future. See for example the Transport Sample Protocol at https://savannah.nongnu.org/projects/tsp/
The idea is the use the logger as a vector of values. When all new values are filled, then call record() to write to the log file/socket/whatever. The logger should be initialized with a descriptive ID (used in file name, for ex:), and the variables names corresponding to the values that will be sent.
Public Types | |
typedef std::vector< double >::const_iterator | const_iterator |
typedef std::vector< double >::iterator | iterator |
Public Member Functions | |
Logger (const std::string &id, const std::vector< std::string > &names) | |
Takes a number of entries and their names This implicitly defines this vector size. All values are initialized with 0.0. | |
virtual void | record () |
Record the previously set values. If a value was not set since the last record, it keeps the same old value (init:0.0) for the new one. | |
Public Attributes | |
std::vector< std::string > | names |
std::string | id |