Provides a generic way to store algorithmic information during runtime. More...
#include <logging.hpp>
Provides a generic way to store algorithmic information during runtime.
The class Logging provides a generic way to store algorithmic information during runtime. This class is part of the UserInterface class, i.e. all classes that are intended to interact with the user inherit the public functionality of the Logging class.
Definition at line 55 of file logging.hpp.
Default constructor.
Definition at line 44 of file logging.cpp.
Logging::~Logging | ( | ) | [virtual] |
Destructor.
Definition at line 49 of file logging.cpp.
int Logging::addLogRecord | ( | LogRecord & | record | ) |
Adds a record to the log collection.
[in] | record | Record to be added. |
Definition at line 58 of file logging.cpp.
returnValue Logging::getAll | ( | LogName | _name, |
MatrixVariablesGrid & | values | ||
) | const [inline] |
Gets all numerical values at all time instants of the item with given name. If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | values | All numerical values at all time instants of given item. |
returnValue Logging::getFirst | ( | LogName | _name, |
DMatrix & | firstValue | ||
) | const [inline] |
Gets numerical value at first time instant of the item with given name. If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | firstValue | Numerical value at first time instant of given item. |
returnValue Logging::getFirst | ( | LogName | _name, |
VariablesGrid & | firstValue | ||
) | const [inline] |
Gets numerical value at first time instant of the item with given name (converts internally used DMatrix into VariablesGrid). If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | firstValue | Numerical value at first time instant of given item. |
returnValue Logging::getLast | ( | LogName | _name, |
DMatrix & | lastValue | ||
) | const [inline] |
Gets numerical value at last time instant of the item with given name. If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | lastValue | Numerical value at last time instant of given item. |
returnValue Logging::getLast | ( | LogName | _name, |
VariablesGrid & | lastValue | ||
) | const [inline] |
Gets numerical value at last time instant of the item with given name (converts internally used DMatrix into VariablesGrid). If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | lastValue | Numerical value at last time instant of given item. |
returnValue Logging::getLogRecord | ( | LogRecord & | _record | ) | const |
Returns the record with certain index from the log collection. This index is not provided when calling the function, but rather obtained by using the alias index of the record. If the record is no alias record, the error RET_INDEX_OUT_OF_BOUNDS is thrown.
[out] | _record | Desired record. |
Definition at line 77 of file logging.cpp.
uint Logging::getNumLogRecords | ( | ) | const |
Returns number of records contained in the log collection.
Definition at line 103 of file logging.cpp.
int Logging::operator<< | ( | LogRecord & | record | ) |
Adds a record to the log collection.
[in] | record | Record to be added. |
Reimplemented in UserInteraction.
Definition at line 52 of file logging.cpp.
returnValue Logging::printLoggingInfo | ( | ) | const |
Prints information on all records and their items on screen.
Definition at line 108 of file logging.cpp.
returnValue Logging::printNumDoubles | ( | ) | const |
Definition at line 117 of file logging.cpp.
returnValue Logging::setAll | ( | LogName | _name, |
const MatrixVariablesGrid & | values | ||
) | [inline] |
Sets all numerical values at all time instants of the item with given name.
[in] | _name | Internal name of item. |
[in] | values | All numerical values at all time instants of given item. |
returnValue Logging::setLast | ( | LogName | _name, |
const DMatrix & | value, | ||
double | time = -INFTY |
||
) | [inline] |
Sets numerical value at last time instant of the item with given name.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
returnValue Logging::setLast | ( | LogName | _name, |
VariablesGrid & | value, | ||
double | time = -INFTY |
||
) | [inline] |
Sets numerical value at last time instant of the item with given name.
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
returnValue Logging::setupLogging | ( | ) | [protected, virtual] |
Prototype member function for setting-up the logging information at initialization of derived classes.
Reimplemented in Process, Controller, IntegrationAlgorithm, SimulationEnvironment, RealTimeAlgorithm, and OptimizationAlgorithm.
Definition at line 134 of file logging.cpp.
returnValue Logging::updateLogRecord | ( | LogRecord & | _record | ) | const |
Updates all items with the record given as argument. In doing so, it is checked for each item whether it is contained within one of of the records of the collection; and if so, the numerical values are copied into the argument record.
[in,out] | _record | Record to be updated |
Definition at line 89 of file logging.cpp.
friend class AlgorithmicBase [friend] |
Definition at line 57 of file logging.hpp.
std::vector< LogRecord > Logging::logCollection [protected] |
Log collection containing a singly-linked list of log records.
Definition at line 275 of file logging.hpp.
int Logging::logIdx [protected] |
Index of a certain log record to be optionally used within derived classes.
Definition at line 277 of file logging.hpp.