Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Shared_Memory_SV.h
blob4b5f09ca357ff8dd66ea241fe3a4251b639e9148
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Shared_Memory_SV.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //=============================================================================
11 #ifndef ACE_SHARED_MALLOC_SV_H
12 #define ACE_SHARED_MALLOC_SV_H
13 #include /**/ "ace/pre.h"
15 #include "ace/Shared_Memory.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/SV_Shared_Memory.h"
23 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 /**
26 * @class ACE_Shared_Memory_SV
28 * @brief Shared memory wrapper based on System V shared memory.
30 * This class provides a very simple-minded shared memory manager. We
31 * strongly recommend that you do NOT use this class. Instead, please
32 * use @c ACE_Malloc, which has much more powerful capabilities.
34 class ACE_Export ACE_Shared_Memory_SV : public ACE_Shared_Memory
36 public:
37 enum
39 ACE_CREATE = IPC_CREAT,
40 ACE_OPEN = 0
43 ACE_Shared_Memory_SV ();
44 ACE_Shared_Memory_SV (key_t id,
45 size_t length,
46 int create = ACE_Shared_Memory_SV::ACE_OPEN,
47 int perms = ACE_DEFAULT_FILE_PERMS,
48 void *addr = 0,
49 int flags = 0);
51 int open (key_t id,
52 size_t length,
53 int create = ACE_Shared_Memory_SV::ACE_OPEN,
54 int perms = ACE_DEFAULT_FILE_PERMS,
55 void *addr = 0,
56 int flags = 0);
58 /// Close down the shared memory segment.
59 virtual int close ();
61 /// Remove the underlying shared memory segment.
62 virtual int remove ();
64 // = Allocation and deallocation methods.
65 /// Create a new chuck of memory containing @a size bytes.
66 virtual void *malloc (size_t = 0);
68 /// Free a chuck of memory allocated by <ACE_Shared_Memory_SV::malloc>.
69 virtual int free (void *p);
71 /// Return the size of the shared memory segment.
72 virtual size_t get_segment_size () const;
74 /// Return the ID of the shared memory segment (i.e., a System V
75 /// shared memory internal id).
76 virtual ACE_HANDLE get_id () const;
78 /// Dump the state of an object.
79 void dump () const;
81 /// Declare the dynamic allocation hooks.
82 ACE_ALLOC_HOOK_DECLARE;
84 private:
85 /// This version is implemented with System V shared memory
86 /// segments.
87 ACE_SV_Shared_Memory shared_memory_;
90 ACE_END_VERSIONED_NAMESPACE_DECL
92 #if defined (__ACE_INLINE__)
93 #include "ace/Shared_Memory_SV.inl"
94 #endif /* __ACE_INLINE__ */
96 #include /**/ "ace/post.h"
97 #endif /* ACE_SHARED_MALLOC_SV_H */