Robotcode  1.0
DataManager< T, N > Class Template Reference

Template class that takes care of memory allocation for recorded data. More...

#include <DataManager.h>

List of all members.

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.
getRecord (int n)
 Returns record n.
void save (ostream &file)
 Save the data currenly contained.
void clear ()

Detailed Description

template<class T, int N>
class DataManager< T, N >

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.

See also:
DataRecord

Constructor & Destructor Documentation

template<class T , int N>
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


Member Function Documentation

template<class T, int N>
bool DataManager< T, N >::record ( datum)

Puts a DataRecord (class T) into allocated array.

/param datum is of class DataRecord /return was there enough space for the record?

template<class T , int N>
void DataManager< T, N >::save ( ostream &  out)

Save the data currenly contained.

/param out Stream linked to mov-file.


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