source: pacpusframework/trunk/include/Pacpus/PacpusTools/ShMemBase.h@ 70

Last change on this file since 70 was 69, checked in by Marek Kurdej, 12 years ago

Added: more documentation.

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