Last change
on this file since 52 was 31, checked in by sgosseli, 12 years ago |
Huge commit: use the new includes style in all the files, add the license header in all the headers, and in some cpp.
|
File size:
1.4 KB
|
Line | |
---|
1 | /**
|
---|
2 | *
|
---|
3 | * Distributed under the UTC Heudiascy Pacpus License, Version 1.0.
|
---|
4 | * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved.
|
---|
5 | *
|
---|
6 | * See the LICENSE file for more information or a copy at:
|
---|
7 | * http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | #ifndef DEF_PACPUS_SHMEMBASE_H
|
---|
12 | #define DEF_PACPUS_SHMEMBASE_H
|
---|
13 |
|
---|
14 | class ShMemBase
|
---|
15 | {
|
---|
16 | public:
|
---|
17 | ShMemBase()
|
---|
18 | {
|
---|
19 | /*printf("ShMemBase::ShMemBase() not implemented !\n");*/
|
---|
20 | }
|
---|
21 |
|
---|
22 | virtual ~ShMemBase()
|
---|
23 | {
|
---|
24 | /*printf("ShMemBase::~ShMemBase() not implemented !\n");*/
|
---|
25 | }
|
---|
26 |
|
---|
27 | // Use this method to get the data of the shared memory
|
---|
28 | virtual void *read() = 0;
|
---|
29 |
|
---|
30 | // Use this method to write data in shared memory
|
---|
31 | virtual void write(void *data, int size, unsigned long offset = 0) = 0;
|
---|
32 |
|
---|
33 | // Use this method to wait the incoming of new data
|
---|
34 | // you can specify a timeout in ms to avoid infinite blocking or 0 (infinite)
|
---|
35 | // return true if new data available before the timeout or else false
|
---|
36 | virtual bool wait(unsigned long timeout = 0) = 0;
|
---|
37 |
|
---|
38 | // To lock the access to the memory
|
---|
39 | virtual void lockMemory() = 0;
|
---|
40 |
|
---|
41 | // To unlock the access to the memory
|
---|
42 | virtual void unlockMemory() = 0;
|
---|
43 |
|
---|
44 | #ifdef WIN32
|
---|
45 | // Return the event handle under Windows
|
---|
46 | // ... under Linux ?
|
---|
47 | virtual void * getEventIdentifier() = 0;
|
---|
48 | #endif
|
---|
49 |
|
---|
50 | protected:
|
---|
51 | void * shMem_;
|
---|
52 |
|
---|
53 | private:
|
---|
54 | };
|
---|
55 |
|
---|
56 | #endif // DEF_PACPUS_SHMEMBASE_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.