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}
13 #ifndef IO_DEVICE_H
14 #define IO_DEVICE_H
15 
16 #include <Object.h>
17 
18 class IODevice_impl;
19 class Thread_impl;
20 class FrameworkManager_impl;
21 
22 namespace flair {
23 namespace core {
24 
25 class io_data;
26 class DataType;
27 
44 class IODevice : public Object {
45  friend class ::IODevice_impl;
46  friend class ::Thread_impl;
47  friend class ::FrameworkManager_impl;
48 
49 public:
62  IODevice(const Object *parent, std::string name);
63 
68  virtual ~IODevice();
69 
83  void AddDeviceToLog(const IODevice *device);
84 
95  void AddDataToLog(const io_data *data);
96 
110  void OutputToShMem(bool enabled);
111 
112  // TODO: these 2 method should be pure virtual
113  virtual DataType const &GetInputDataType() const;
114  virtual DataType const &GetOutputDataType() const;
115 
116  Time lastUpdate;
117  protected:
131  void ProcessUpdate(io_data* data);
132 
133 private:
144  virtual void UpdateFrom(const io_data *data) = 0;
145 
146  class IODevice_impl *pimpl_;
147 };
148 
149 } // end namespace core
150 } // end namespace flair
151 
152 #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:77
Abstract class for input/ouput system.
Definition: IODevice.h:44
namespace of the flair Framework
Definition: Ahrs.h:19
unsigned long long Time
Time definition, in ns.
Definition: Object.h:49
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.
Base class for all Framework's classes.
virtual ~IODevice()
Destructor.
void AddDeviceToLog(const IODevice *device)
Add an IODevice to the logs.