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

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

Modified property: added svn:keywords=Id.

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