Flair
Framework Libre Air
IODevice.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
5 // ---
14 #ifndef IO_DEVICE_H
15 #define IO_DEVICE_H
16 
17 #include <Object.h>
18 
19 class IODevice_impl;
20 class Thread_impl;
21 class FrameworkManager_impl;
22 
23 namespace flair {
24 namespace core {
25 
26 class io_data;
27 class DataType;
28 
45 class IODevice : public Object {
46  friend class ::IODevice_impl;
47  friend class ::Thread_impl;
48  friend class ::FrameworkManager_impl;
49 
50 public:
63  IODevice(const Object *parent, std::string name);
64 
69  virtual ~IODevice();
70 
84  void AddDeviceToLog(const IODevice *device);
85 
96  void AddDataToLog(const io_data *data);
97 
111  void OutputToShMem(bool enabled);
112 
121  bool IsReady(void) const;
122 
123  // TODO: these 2 method should be pure virtual
124  virtual DataType const &GetInputDataType() const;
125  virtual DataType const &GetOutputDataType() const;
126 
127  protected:
141  void ProcessUpdate(io_data* data);
142 
151  void SetIsReady(bool status);
152 
163  virtual void UpdateFrom(const io_data *data) = 0;
164 
165  private:
166  class IODevice_impl *pimpl_;
167 };
168 
169 } // end namespace core
170 } // end namespace flair
171 
172 #endif // IO_DEVICE_H
Abstract class for data types.
Definition: io_data.h:94
Definition: io_data.h:26
Base class for all Framework's classes.
Definition: Object.h:83
Abstract class for input/ouput system.
Definition: IODevice.h:45
namespace of the flair Framework
Definition: Ahrs.h:19
void ProcessUpdate(io_data *data)
Process the childs of type IODevice, and log if needed.
void AddDataToLog(const io_data *data)
Add an io_data to the log.
void OutputToShMem(bool enabled)
Send the output to a shared memory.
IODevice(const Object *parent, std::string name)
Constructor.
virtual void UpdateFrom(const io_data *data)=0
Update using provided datas.
Base class for all Framework's classes.
virtual ~IODevice()
Destructor.
void SetIsReady(bool status)
set is ready
void AddDeviceToLog(const IODevice *device)
Add an IODevice to the logs.
bool IsReady(void) const
is device ready