source: pacpusframework/trunk/include/Pacpus/PacpusTools/PosixShMem.h@ 57

Last change on this file since 57 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: 909 bytes
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_POSIXSHMEM_H
12#define DEF_PACPUS_POSIXSHMEM_H
13
14#include <QSharedMemory>
15#include <QSystemSemaphore>
16
17#include <Pacpus/PacpusTools/ShMemBase.h>
18
19class PosixShMem
20 : public ShMemBase
21{
22public:
23 PosixShMem(const char * name, int size);
24 virtual ~PosixShMem();
25
26 virtual void *read();
27 virtual void write(void *data, int size, unsigned long offset = 0);
28 virtual bool wait(unsigned long timeout = 0);
29 virtual void lockMemory();
30 virtual void unlockMemory();
31
32private:
33 QSystemSemaphore * event_;
34 QSharedMemory * memory_;
35};
36
37#endif // DEF_PACPUS_POSIXSHMEM_H
Note: See TracBrowser for help on using the repository browser.