source: pacpusframework/branches/0.1.x/include/Pacpus/PacpusTools/ShMemBase.h@ 198

Last change on this file since 198 was 162, checked in by Marek Kurdej, 11 years ago

Update: merged changes from trunk.

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @file
6/// @author Firstname Surname <firstname.surname@utc.fr>
7/// @date Month, Year
8/// @version $Id: ShMemBase.h 76 2013-01-10 17:05:10Z kurdejma $
9/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
10/// @brief Brief description.
11///
12/// Detailed description.
13
14#ifndef DEF_PACPUS_SHMEMBASE_H
15#define DEF_PACPUS_SHMEMBASE_H
16
17#include "PacpusToolsConfig.h"
18
19/// Base class for shared memory objects.
20class PACPUSTOOLS_API ShMemBase
21{
22public:
23 /// Ctor
24 ShMemBase()
25 {
26 }
27
28 /// Dtor
29 virtual ~ShMemBase()
30 {
31 }
32
33 /// Use this method to get the data of the shared memory
34 virtual void *read() = 0;
35
36 /// Use this method to write data in shared memory
37 virtual void write(void *data, int size, unsigned long offset = 0) = 0;
38
39 /// Use this method to wait the incoming of new data
40 /// you can specify a timeout in ms to avoid infinite blocking or 0 (infinite)
41 /// @returns @b true if new data available before the timeout, @b false otherwise
42 virtual bool wait(unsigned long timeout = 0) = 0;
43
44 /// To lock the access to the memory
45 virtual void lockMemory() = 0;
46
47 /// To unlock the access to the memory
48 virtual void unlockMemory() = 0;
49
50#ifdef WIN32
51 /// Return the event handle under Windows
52 /// @todo ... under Linux ?
53 virtual void * getEventIdentifier() = 0;
54#endif
55
56protected:
57 /// @todo Documentation
58 void * shMem_;
59
60private:
61};
62
63#endif // DEF_PACPUS_SHMEMBASE_H
Note: See TracBrowser for help on using the repository browser.