Last change
on this file since 18 was 3, checked in by sgosseli, 12 years ago |
- Add the existing Pacpus files from pacpusdev and pacpuscore.
- Provide a clean build system based on multiple CMake files.
|
File size:
1.5 KB
|
Rev | Line | |
---|
[3] | 1 | /*********************************************************************
|
---|
| 2 | // created: 2006/12/30 - 17:35
|
---|
| 3 | // filename: ShMemBase.h
|
---|
| 4 | //
|
---|
| 5 | // author: Gerald Dherbomez
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: ShMemBase.h 929 2012-03-27 15:49:00Z kurdejma $
|
---|
| 8 | //
|
---|
| 9 | // purpose: Abstract class for shared memory
|
---|
| 10 | *********************************************************************/
|
---|
| 11 |
|
---|
| 12 | #ifndef SHMEMBASE_H
|
---|
| 13 | #define SHMEMBASE_H
|
---|
| 14 |
|
---|
| 15 | class ShMemBase
|
---|
| 16 | {
|
---|
| 17 | public:
|
---|
| 18 | ShMemBase()
|
---|
| 19 | {
|
---|
| 20 | /*printf("ShMemBase::ShMemBase() not implemented !\n");*/
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | virtual ~ShMemBase()
|
---|
| 24 | {
|
---|
| 25 | /*printf("ShMemBase::~ShMemBase() not implemented !\n");*/
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | // Use this method to get the data of the shared memory
|
---|
| 29 | virtual void *read() = 0;
|
---|
| 30 |
|
---|
| 31 | // Use this method to write data in shared memory
|
---|
| 32 | virtual void write(void *data, int size, unsigned long offset = 0) = 0;
|
---|
| 33 |
|
---|
| 34 | // Use this method to wait the incoming of new data
|
---|
| 35 | // you can specify a timeout in ms to avoid infinite blocking or 0 (infinite)
|
---|
| 36 | // return true if new data available before the timeout or else false
|
---|
| 37 | virtual bool wait(unsigned long timeout = 0) = 0;
|
---|
| 38 |
|
---|
| 39 | // To lock the access to the memory
|
---|
| 40 | virtual void lockMemory() = 0;
|
---|
| 41 |
|
---|
| 42 | // To unlock the access to the memory
|
---|
| 43 | virtual void unlockMemory() = 0;
|
---|
| 44 |
|
---|
| 45 | #ifdef WIN32
|
---|
| 46 | // Return the event handle under Windows
|
---|
| 47 | // ... under Linux ?
|
---|
| 48 | virtual void * getEventIdentifier() = 0;
|
---|
| 49 | #endif
|
---|
| 50 |
|
---|
| 51 | protected:
|
---|
| 52 | void * shMem_;
|
---|
| 53 |
|
---|
| 54 | private:
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 | #endif // SHMEMBASE_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.