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