source: pacpusframework/trunk/include/Pacpus/PacpusTools/ShMem.h@ 84

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

Added: automated license updating lines:
%pacpus:license{
%pacpus:license}

  • 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 Firstname Surname <firstname.surname@utc.fr>
7/// @date Month, Year
8/// @version $Id: ShMem.h 76 2013-01-10 17:05:10Z kurdejma $
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.