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:
785 bytes
|
Rev | Line | |
---|
[3] | 1 | #ifndef POSIXSHMEM_H
|
---|
| 2 | #define POSIXSHMEM_H
|
---|
| 3 |
|
---|
| 4 | #include <qsharedmemory.h>
|
---|
| 5 | #include <qsystemsemaphore.h>
|
---|
| 6 |
|
---|
| 7 | #include "ShMemBase.h"
|
---|
| 8 |
|
---|
| 9 | /*
|
---|
| 10 | union semun{
|
---|
| 11 | int val ;
|
---|
| 12 | struct semid_ds * buf;
|
---|
| 13 | unsigned short array[1];
|
---|
| 14 | };
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 | class PosixShMem
|
---|
| 18 | : public ShMemBase
|
---|
| 19 | {
|
---|
| 20 | public:
|
---|
| 21 | PosixShMem(const char * name, int size);
|
---|
| 22 | virtual ~PosixShMem();
|
---|
| 23 |
|
---|
| 24 | virtual void *read();
|
---|
| 25 | virtual void write(void *data, int size, unsigned long offset = 0);
|
---|
| 26 | virtual bool wait(unsigned long timeout = 0);
|
---|
| 27 | virtual void lockMemory();
|
---|
| 28 | virtual void unlockMemory();
|
---|
| 29 |
|
---|
| 30 | protected:
|
---|
| 31 |
|
---|
| 32 | private:
|
---|
| 33 | // int shMemHandle_;
|
---|
| 34 | // int semaphore_id;
|
---|
| 35 | // semun sem_arg_ctl;
|
---|
| 36 | QSystemSemaphore * event_;
|
---|
| 37 | QSharedMemory * memory_;
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | #endif // POSIXSHMEM_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.