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 | /*!
|
---|
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 |
|
---|
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;
|
---|
27 | }
|
---|
28 | }
|
---|
29 |
|
---|
30 | class FrameworkManager_impl;
|
---|
31 |
|
---|
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);
|
---|
44 | void SetToBeLogged(void);
|
---|
45 | bool IsSetToBeLogged(void) const;
|
---|
46 | void OutputToShMem(bool enabled);
|
---|
47 | void WriteToShMem(void);
|
---|
48 | void PrintLogsDescriptors(void);
|
---|
49 |
|
---|
50 | private:
|
---|
51 | std::vector<const flair::core::IODevice *> devicesToLog;
|
---|
52 | const flair::core::IODevice *self;
|
---|
53 | const flair::core::FrameworkManager *framework;
|
---|
54 | FrameworkManager_impl *framework_impl;
|
---|
55 | std::vector<const flair::core::io_data *> datasToLog;
|
---|
56 | flair::core::Thread *thread_to_wake;
|
---|
57 | flair::core::Mutex *wake_mutex;
|
---|
58 | bool tobelogged;
|
---|
59 | bool outputtoshm;
|
---|
60 | flair::core::SharedMem *shmem;
|
---|
61 | };
|
---|
62 |
|
---|
63 | #endif // IO_DEVICE_IMPL_H
|
---|