source: pacpusframework/trunk/include/Pacpus/PacpusTools/Win32ShMem.h@ 114

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

Minor: added pacpus namespace in Win32ShMem.
Ignored dll-interface warnings in MSVC (unimportant because concerns STL): C4251, C4275.

  • Property svn:keywords set to Id
File size: 1.9 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 Gerald Dherbomez <firstname.surname@utc.fr>
7/// @date January, 2007
8/// @version $Id: Win32ShMem.h 114 2013-06-25 08:55:43Z kurdejma $
9/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
10/// @brief Shared memory implementation for Windows.
11///
12/// Shared memory implementation for Windows.
13/// @todo Derive from a common base class. Same for @link PosixShMem @endlink.
14
15#ifndef DEF_PACPUS_WIN32SHMEM_H
16#define DEF_PACPUS_WIN32SHMEM_H
17
18#include "Pacpus\kernel\PacpusToolsConfig.h"
19
20#include <Pacpus/PacpusTools/ShMemBase.h>
21
22/// Windows handle (opaque pointer) type definition
23///
24/// Forward declaration of typedefs is impossible.
25typedef void * HANDLE;
26
27#ifdef _MSC_VER
28# pragma warning(push)
29# pragma warning(disable: 4275)
30#endif // _MSC_VER
31
32namespace pacpus {
33
34/// Shared memory object for Windows.
35class PACPUSTOOLS_API Win32ShMem
36 : public ShMemBase
37{
38public:
39 /// Ctor
40 Win32ShMem(const char * name, int size);
41 /// Dtor
42 ~Win32ShMem();
43
44 /// @todo Documentation
45 virtual bool wait(unsigned long timeout = 0);
46 /// @todo Documentation
47 virtual void * read();
48 /// @todo Documentation
49 virtual void read(void * mem, int size);
50 /// @todo Documentation
51 virtual void write(void * data, int size, unsigned long offset = 0);
52 /// @todo Documentation
53 virtual void lockMemory();
54 /// @todo Documentation
55 virtual void unlockMemory();
56 /// @todo Documentation
57 virtual void * getEventIdentifier();
58
59protected:
60
61private:
62 HANDLE semaphore_;
63 HANDLE shMemHandle_;
64 HANDLE event_;
65};
66
67} // namespace pacpus
68
69#ifdef _MSC_VER
70# pragma warning(pop)
71#endif // _MSC_VER
72
73#endif // DEF_PACPUS_WIN32SHMEM_H
Note: See TracBrowser for help on using the repository browser.