Flair
Framework Libre Air
|
Abstract class for data types. More...
#include <io_data.h>
Public Member Functions | |
io_data (const Object *parent, std::string name, int n) | |
Constructor. More... | |
virtual | ~io_data () |
Destructor. More... | |
void | SetDataTime (Time time) |
Set data time, also caluculates the delta time based on last call. More... | |
void | SetDataTime (Time time, Time deltaTime) |
Set data time and delta time (thus delta time is not based on last call) More... | |
Time | DataTime (void) const |
Data time. More... | |
Time | DataDeltaTime (void) const |
Data delta time. More... | |
void | GetDataTime (Time &time, Time &deltaTime) const |
Get data time and delta time. More... | |
const io_data * | Prev (int n) const |
Previous data. More... | |
virtual DataType const & | GetDataType () const =0 |
virtual void | RawWrite (char *src) |
Raw write datas. More... | |
virtual void | RawRead (char *dst) const =0 |
Raw read datas. More... | |
Public Member Functions inherited from flair::core::Mutex | |
Mutex (const Object *parent, std::string name="") | |
Constructor. More... | |
~Mutex () | |
Destructor. More... | |
void | GetMutex (void) const |
GetMutex. More... | |
void | ReleaseMutex (void) const |
ReleaseMutex. More... | |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Protected Member Functions | |
void | AppendLogDescription (std::string description, DataType const &datatype) |
Specify the description of the reimplemented class data's. More... | |
void | SetPtrToCircle (void **ptr) |
Set the datas to circle. More... | |
Protected Attributes | |
io_data * | prev |
Pointer to previous data. More... | |
Additional Inherited Members | |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Abstract class for data types.
Use this class to define a custom data type. Data types ares used for logging and graphs.
The reimplemented class must call SetSize() in its constructor.
io_data can be constructed with n samples (see io_data::io_data). In this case, old samples can be accessed throug io_data::Prev.
flair::core::io_data::io_data | ( | const Object * | parent, |
std::string | name, | ||
int | n | ||
) |
|
virtual |
Destructor.
void flair::core::io_data::SetDataTime | ( | Time | time | ) |
Set data time, also caluculates the delta time based on last call.
TIME_INFINITE represents an unitialized time
time | time |
Set data time and delta time (thus delta time is not based on last call)
TIME_INFINITE represents an unitialized time
time | time |
deltaTime | delta time |
Time flair::core::io_data::DataTime | ( | void | ) | const |
Data time.
TIME_INFINITE represents an unitialized time.
Time flair::core::io_data::DataDeltaTime | ( | void | ) | const |
Data delta time.
TIME_INFINITE represents an unitialized time.
Get data time and delta time.
TIME_INFINITE represents an unitialized time
time | time |
deltaTime | delta time |
const io_data* flair::core::io_data::Prev | ( | int | n | ) | const |
Previous data.
Access previous data. io_data must have been constructed with n>1, io_data::SetPtrToCircle must have been set and io_data::prev must have been allocated.
n | previous data number |
|
inlinevirtual |
Raw write datas.
Copy the source to the internal datas. Source must be of the corresponding size.
src | source buffer |
Reimplemented in flair::core::Matrix.
|
pure virtual |
Raw read datas.
This method is automatically called by IODevice::ProcessUpdate to log io_data datas.
This method must be reimplemented, in order to copy the datas to the logs. Copy the internal datas to destination. Destination must be of the corresponding size.
dst | destination buffer |
Implemented in flair::core::GpsData, and flair::core::Matrix.
|
protected |
Specify the description of the reimplemented class data's.
This method must be called in the constructor of the reimplemented class, once by element.
Each element description must be called in the same order as CopyDatas put the datas in the buffer.
The description will be used for the log descriptor file.
description | description of the element |
datatype | type of the element |
|
protected |
Set the datas to circle.
ptr | pointer to the data to circle |
|
protected |
Pointer to previous data.
Reimplemented class must allocate this pointer if n>1.
Pointer must be allocated with the same kind of reimplemented class.