LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
Logger Class Reference

Logs data from Loggable classes to a global log file in binary format each cycle. More...

#include <Logger.h>

Inheritance diagram for Logger:
Collaboration diagram for Logger:

Public Member Functions

void Initialize ()
 Writes the header file and allocates the block of memory to log to.
 
void Run ()
 Logs all data from one cycle into the log file.
 
template<typename T >
void Log (T *field, std::size_t size, std::string name, std::string source)
 Saves a number of bytes from a variable for logging.
 
template<typename T >
void Log (T *field, std::string name, std::string source)
 Saves a variable for logging.
 
template<typename T >
void Log (T value, std::string name, std::string source)
 Saves a value for logging.
 
- Public Member Functions inherited from SynchronizedProcess
void RunOneCycle ()
 Gives a semaphore which allows Tick() to be called.
 
virtual void preTick ()
 Takes a semaphore which blocks Tick() until RunOneCycle() is called.
 

Static Public Member Functions

static void RegisterLoggable (Loggable *loggable)
 Registers a Loggable object for logging.
 

Detailed Description

Logs data from Loggable classes to a global log file in binary format each cycle.

Member Function Documentation

template<typename T >
void Logger::Log ( T *  field,
std::size_t  size,
std::string  name,
std::string  source 
)
inline

Saves a number of bytes from a variable for logging.

Parameters
fieldpointer to the variable
sizenumber of bytes to write from the pointer
namename of the field
sourcename of the Loggable object that logged this field

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void Logger::Log ( T *  field,
std::string  name,
std::string  source 
)
inline

Saves a variable for logging.

Parameters
fieldpointer to the variable
namename of the field
sourcename of the Loggable object that logged this variable

Here is the call graph for this function:

template<typename T >
void Logger::Log ( value,
std::string  name,
std::string  source 
)
inline

Saves a value for logging.

Parameters
valuevalue to log
namename of the field
sourcename of the Loggable object that logged this field

Here is the call graph for this function:

void Logger::RegisterLoggable ( Loggable loggable)
static

Registers a Loggable object for logging.

Parameters
loggablethe Loggable object to register

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