[2] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file IODevice_impl.h
|
---|
| 7 | * \brief Classe de base pour un système à entrées/sorties
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2011/05/01
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef IO_DEVICE_IMPL_H
|
---|
| 14 | #define IO_DEVICE_IMPL_H
|
---|
| 15 |
|
---|
| 16 | #include <string>
|
---|
| 17 | #include <Object.h>
|
---|
| 18 |
|
---|
[15] | 19 | namespace flair {
|
---|
| 20 | namespace core {
|
---|
| 21 | class io_data;
|
---|
| 22 | class IODevice;
|
---|
| 23 | class Thread;
|
---|
| 24 | class Mutex;
|
---|
| 25 | class FrameworkManager;
|
---|
| 26 | class SharedMem;
|
---|
[2] | 27 | }
|
---|
[15] | 28 | }
|
---|
[2] | 29 |
|
---|
| 30 | class FrameworkManager_impl;
|
---|
| 31 |
|
---|
[15] | 32 | class IODevice_impl {
|
---|
| 33 | public:
|
---|
| 34 | IODevice_impl(const flair::core::IODevice *self);
|
---|
| 35 | ~IODevice_impl();
|
---|
| 36 | void ResumeThread(void);
|
---|
| 37 | size_t LogSize(void) const;
|
---|
| 38 | void AppendLog(char **ptr);
|
---|
| 39 | void AddDataToLog(const flair::core::io_data *data);
|
---|
| 40 | void WriteLogsDescriptors(std::fstream &desc_file, int *index);
|
---|
| 41 | int SetToWake(const flair::core::Thread *thread);
|
---|
| 42 | void WriteLog(flair::core::Time time);
|
---|
| 43 | void AddDeviceToLog(const flair::core::IODevice *device);
|
---|
[122] | 44 | void SetToBeLogged(void);
|
---|
| 45 | bool IsSetToBeLogged(void) const;
|
---|
[15] | 46 | void OutputToShMem(bool enabled);
|
---|
| 47 | void WriteToShMem(void);
|
---|
| 48 | void PrintLogsDescriptors(void);
|
---|
[157] | 49 | void SetIsReady(bool status);
|
---|
| 50 | bool IsReady(void) const;
|
---|
[2] | 51 |
|
---|
[15] | 52 | private:
|
---|
| 53 | std::vector<const flair::core::IODevice *> devicesToLog;
|
---|
| 54 | const flair::core::IODevice *self;
|
---|
| 55 | const flair::core::FrameworkManager *framework;
|
---|
| 56 | FrameworkManager_impl *framework_impl;
|
---|
| 57 | std::vector<const flair::core::io_data *> datasToLog;
|
---|
| 58 | flair::core::Thread *thread_to_wake;
|
---|
| 59 | flair::core::Mutex *wake_mutex;
|
---|
| 60 | bool tobelogged;
|
---|
| 61 | bool outputtoshm;
|
---|
| 62 | flair::core::SharedMem *shmem;
|
---|
[157] | 63 | bool isReady;
|
---|
[2] | 64 | };
|
---|
| 65 |
|
---|
| 66 | #endif // IO_DEVICE_IMPL_H
|
---|