source: pacpusframework/branches/0.0.x/include/Pacpus/PacpusTools/ShMem.h

Last change on this file was 91, checked in by DHERBOMEZ Gérald, 11 years ago

Improvement of the build system to avoid some workarounds

  • Property svn:keywords set to Id
File size: 1.6 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: ShMem.h 91 2013-05-19 10:32:48Z gdherbom $
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_SHMEM_H
15#define DEF_PACPUS_SHMEM_H
16
17#ifdef WIN32
18# include "Win32ShMem.h"
19/// Defines shared memory as a Windows shared memory
20# define ShMemType Win32ShMem
21#else
22# include "PosixShMem.h"
23/// Defines shared memory as a POSIX shared memory
24# define ShMemType PosixShMem
25#endif
26
27namespace pacpus {
28
29/// Shared memory class.
30///
31/// Inherits from Win32ShMem on Windows system and from PosixShMem on Unix-like systems.
32class ShMem
33 : public ShMemType
34{
35public:
36 /// Ctor of shared memory class.
37 ///
38 /// Creates a shared memory of size @b size and named @b name.
39 /// If a shared memory with the name @b name already exists, than
40 /// it will return object pointing to the same memory.
41 /// If this existing memory space has a size smaller than @b size,
42 /// a warning will be issued.
43 ///
44 /// @param name Name of the created shared memory space.
45 /// @param size Size of the created shared memory space in [bytes].
46 ShMem(const char * name, int size)
47 : ShMemType(name, size)
48 {
49 }
50
51 /// Dtor of shared memory class.
52 ///
53 /// Does nothing.
54 ~ShMem()
55 {
56 }
57
58protected:
59private:
60};
61
62} // namespace pacpus
63
64#endif // DEF_PACPUS_SHMEM_H
Note: See TracBrowser for help on using the repository browser.