Rev | Line | |
---|
[62] | 1 | // This file is part of the PACPUS framework distributed under the
|
---|
| 2 | // CECILL-C License, Version 1.0.
|
---|
| 3 | //
|
---|
| 4 | /// @author Gerald Dherbomez <firstname.surname@utc.fr>
|
---|
| 5 | /// @date January, 2007
|
---|
| 6 | /// @version $Id$
|
---|
| 7 | /// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
|
---|
| 8 | /// @brief Shared memory implementation for Windows.
|
---|
| 9 | ///
|
---|
| 10 | /// Shared memory implementation for Windows.
|
---|
| 11 | /// @todo Derive from a common base class. Same for @link PosixShMem.
|
---|
[3] | 12 |
|
---|
[31] | 13 | #ifndef DEF_PACPUS_WIN32SHMEM_H
|
---|
| 14 | #define DEF_PACPUS_WIN32SHMEM_H
|
---|
[3] | 15 |
|
---|
[31] | 16 | #include <Pacpus/PacpusTools/ShMemBase.h>
|
---|
[3] | 17 |
|
---|
| 18 | typedef void * HANDLE;
|
---|
| 19 |
|
---|
| 20 | class Win32ShMem
|
---|
| 21 | : public ShMemBase
|
---|
| 22 | {
|
---|
| 23 | public:
|
---|
| 24 | Win32ShMem(const char * name, int size);
|
---|
| 25 | ~Win32ShMem();
|
---|
| 26 |
|
---|
| 27 | virtual bool wait(unsigned long timeout = 0);
|
---|
| 28 | virtual void * read();
|
---|
| 29 | virtual void read(void * mem, int size);
|
---|
| 30 | virtual void write(void * data, int size, unsigned long offset = 0);
|
---|
| 31 | virtual void lockMemory();
|
---|
| 32 | virtual void unlockMemory();
|
---|
| 33 | virtual void * getEventIdentifier();
|
---|
| 34 |
|
---|
| 35 | protected:
|
---|
| 36 |
|
---|
| 37 | private:
|
---|
| 38 | HANDLE semaphore_;
|
---|
| 39 | HANDLE shMemHandle_;
|
---|
| 40 | HANDLE event_;
|
---|
| 41 | };
|
---|
| 42 |
|
---|
[31] | 43 | #endif // DEF_PACPUS_WIN32SHMEM_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.