Flair
Framework Libre Air
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
flair::core::io_data Class Referenceabstract

Abstract class for data types. More...

#include <io_data.h>

+ Inheritance diagram for flair::core::io_data:

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. More...
 
Time DataTime (void) const
 Data time. More...
 
const io_dataPrev (int n) const
 Previous data. More...
 
virtual DataType const & GetDataType () const =0
 
- 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 ObjectParent (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_dataprev
 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 }
 

Detailed Description

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.

Constructor & Destructor Documentation

flair::core::io_data::io_data ( const Object parent,
std::string  name,
int  n 
)

Constructor.

Construct an io_data.

Parameters
parentparent
namename
nnumber of samples
virtual flair::core::io_data::~io_data ( )
virtual

Destructor.

Member Function Documentation

void flair::core::io_data::SetDataTime ( Time  time)

Set data time.

Parameters
timetime
Time flair::core::io_data::DataTime ( void  ) const

Data time.

Returns
data 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.

Parameters
nprevious data number
Returns
previous data
void flair::core::io_data::AppendLogDescription ( std::string  description,
DataType const &  datatype 
)
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.

Parameters
descriptiondescription of the element
datatypetype of the element
void flair::core::io_data::SetPtrToCircle ( void **  ptr)
protected

Set the datas to circle.

Parameters
ptrpointer to the data to circle

Member Data Documentation

io_data* flair::core::io_data::prev
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.