Robotcode
1.0
|
Template class that takes care of memory allocation for recorded data. More...
#include <DataManager.h>
Public Member Functions | |
DataManager () | |
Constructor. | |
~DataManager () | |
Destructor. | |
void | startRecording (void) |
Start the recording. | |
void | stopRecording (void) |
Stop the recording. | |
bool | isRecording (void) |
int | numRecords (void) |
Returns the number of recorded data. | |
bool | record (T) |
Puts a DataRecord (class T) into allocated array. | |
T | getRecord (int n) |
Returns record n. | |
void | save (ostream &file) |
Save the data currenly contained. | |
void | clear () |
Template class that takes care of memory allocation for recorded data.
Record object make sure that data get recorded properly. It ensures that data is written out in case of program crash. You just havbe to specify a DataRecord Object that can be plugged in. It also gives you access to previously recorded data, in case you want to replay a trial to the subject or do some off-line computation. If the data array structure overflows, DataManager will automatically kill older data to store the more recent one.
DataManager< T, N >::DataManager | ( | ) |
Constructor.
Example usage: DataManager <DataRecord,2000>: holds 2000 of class data record. /param T Class Type to be plugged in (DataRecord) /param N Maximal numbers of records to be stored
bool DataManager< T, N >::record | ( | T | datum | ) |
Puts a DataRecord (class T) into allocated array.
/param datum is of class DataRecord /return was there enough space for the record?
void DataManager< T, N >::save | ( | ostream & | out | ) |
Save the data currenly contained.
/param out Stream linked to mov-file.