Last change
on this file since 34 was 13, checked in by Bayard Gildas, 9 years ago |
formatting script + include reformatted
|
File size:
1.3 KB
|
Rev | Line | |
---|
[2] | 1 | // %flair:license{
|
---|
[13] | 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 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 |
|
---|
[13] | 21 | namespace flair {
|
---|
| 22 | namespace core {
|
---|
[2] | 23 |
|
---|
[13] | 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 | */
|
---|
[2] | 31 |
|
---|
[13] | 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);
|
---|
[2] | 44 |
|
---|
[13] | 45 | /*!
|
---|
| 46 | * \brief Destructor
|
---|
| 47 | *
|
---|
| 48 | */
|
---|
| 49 | ~SharedMem();
|
---|
[2] | 50 |
|
---|
[13] | 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);
|
---|
[2] | 58 |
|
---|
[13] | 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;
|
---|
[2] | 66 |
|
---|
[13] | 67 | private:
|
---|
| 68 | SharedMem_impl *pimpl_;
|
---|
| 69 | };
|
---|
[2] | 70 |
|
---|
| 71 | } // end namespace core
|
---|
| 72 | } // end namespace flair
|
---|
| 73 |
|
---|
| 74 | #endif // SHAREDMEM_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.