Last change
on this file since 48 was 15, checked in by Bayard Gildas, 9 years ago |
sources reformatted with flair-format-dir script
|
File size:
1.3 KB
|
Line | |
---|
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 SharedMem.h
|
---|
7 | * \brief Class defining a shared memory
|
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2014/02/10
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef SHAREDMEM_H
|
---|
14 | #define SHAREDMEM_H
|
---|
15 |
|
---|
16 | #include <Object.h>
|
---|
17 | #include <semaphore.h>
|
---|
18 |
|
---|
19 | class SharedMem_impl;
|
---|
20 |
|
---|
21 | namespace flair {
|
---|
22 | namespace core {
|
---|
23 |
|
---|
24 | /*! \class SharedMem
|
---|
25 | *
|
---|
26 | * \brief Class defining a shared memory
|
---|
27 | *
|
---|
28 | * Shared memory is identified by its name so it can be accessed
|
---|
29 | * by another processus using its name.
|
---|
30 | */
|
---|
31 |
|
---|
32 | class SharedMem : public Object {
|
---|
33 | public:
|
---|
34 | /*!
|
---|
35 | * \brief Constructor
|
---|
36 | *
|
---|
37 | * Construct a shared memory object
|
---|
38 | *
|
---|
39 | * \param parent parent
|
---|
40 | * \param name name
|
---|
41 | * \param size size of the shared memory
|
---|
42 | */
|
---|
43 | SharedMem(const Object *parent, std::string name, size_t size);
|
---|
44 |
|
---|
45 | /*!
|
---|
46 | * \brief Destructor
|
---|
47 | *
|
---|
48 | */
|
---|
49 | ~SharedMem();
|
---|
50 |
|
---|
51 | /*!
|
---|
52 | * \brief Write
|
---|
53 | *
|
---|
54 | * \param buf input buffer to write to memory
|
---|
55 | * \param size buffer size
|
---|
56 | */
|
---|
57 | void Write(const char *buf, size_t size);
|
---|
58 |
|
---|
59 | /*!
|
---|
60 | * \brief Read
|
---|
61 | *
|
---|
62 | * \param buf output buffer to write from memory
|
---|
63 | * \param size buffer size
|
---|
64 | */
|
---|
65 | void Read(char *buf, size_t size) const;
|
---|
66 |
|
---|
67 | private:
|
---|
68 | SharedMem_impl *pimpl_;
|
---|
69 | };
|
---|
70 |
|
---|
71 | } // end namespace core
|
---|
72 | } // end namespace flair
|
---|
73 |
|
---|
74 | #endif // SHAREDMEM_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.