Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Shared_Memory_SV Class Reference

Shared memory wrapper based on System V shared memory. More...

#include <Shared_Memory_SV.h>

Inheritance diagram for ACE_Shared_Memory_SV:

Inheritance graph
[legend]
Collaboration diagram for ACE_Shared_Memory_SV:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { ACE_CREATE = IPC_CREAT, ACE_OPEN = 0 }

Public Methods

 ACE_Shared_Memory_SV (void)
 ACE_Shared_Memory_SV (key_t id, int length, int create=ACE_Shared_Memory_SV::ACE_OPEN, int perms=ACE_DEFAULT_FILE_PERMS, void *addr=0, int flags=0)
int open (key_t id, int length, int create=ACE_Shared_Memory_SV::ACE_OPEN, int perms=ACE_DEFAULT_FILE_PERMS, void *addr=0, int flags=0)
virtual int close (void)
 Close down the shared memory segment. More...

virtual int remove (void)
 Remove the underlying shared memory segment. More...

virtual void * malloc (size_t=0)
 Create a new chuck of memory containing <size> bytes. More...

virtual int free (void *p)
 Free a chuck of memory allocated by <ACE_Shared_Memory_SV::malloc>. More...

virtual int get_segment_size (void) const
 Return the size of the shared memory segment. More...

virtual ACE_HANDLE get_id (void) const
 Return the ID of the shared memory segment (i.e., a System V shared memory internal id). More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

ACE_SV_Shared_Memory shared_memory_
 This version is implemented with System V shared memory segments. More...


Detailed Description

Shared memory wrapper based on System V shared memory.

This class provides a very simple-minded shared memory manager. For more a powerful memory allocator please see <ACE_Malloc>.

Definition at line 35 of file Shared_Memory_SV.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
ACE_CREATE 
ACE_OPEN 

Definition at line 38 of file Shared_Memory_SV.h.

00039     {
00040       ACE_CREATE = IPC_CREAT,
00041       ACE_OPEN = 0
00042     };


Constructor & Destructor Documentation

ACE_INLINE ACE_Shared_Memory_SV::ACE_Shared_Memory_SV void   
 

Definition at line 65 of file Shared_Memory_SV.i.

References ACE_TRACE.

00066 {
00067   ACE_TRACE ("ACE_Shared_Memory_SV::ACE_Shared_Memory_SV");
00068 }

ACE_Shared_Memory_SV::ACE_Shared_Memory_SV key_t    id,
int    length,
int    create = ACE_Shared_Memory_SV::ACE_OPEN,
int    perms = ACE_DEFAULT_FILE_PERMS,
void *    addr = 0,
int    flags = 0
 

Definition at line 21 of file Shared_Memory_SV.cpp.

References ACE_TRACE.

00027   : shared_memory_ (id, length, create, perms, addr, flags)
00028 {
00029   ACE_TRACE ("ACE_Shared_Memory_SV::ACE_Shared_Memory_SV");
00030 }


Member Function Documentation

ACE_INLINE int ACE_Shared_Memory_SV::close void    [virtual]
 

Close down the shared memory segment.

Implements ACE_Shared_Memory.

Definition at line 42 of file Shared_Memory_SV.i.

References ACE_TRACE, ACE_SV_Shared_Memory::detach, and shared_memory_.

00043 {
00044   ACE_TRACE ("ACE_Shared_Memory_SV::close");
00045   return shared_memory_.detach ();
00046 }

void ACE_Shared_Memory_SV::dump void    const
 

Dump the state of an object.

Definition at line 16 of file Shared_Memory_SV.cpp.

References ACE_TRACE.

00017 {
00018   ACE_TRACE ("ACE_Shared_Memory_SV::dump");
00019 }

ACE_INLINE int ACE_Shared_Memory_SV::free void *    p [virtual]
 

Free a chuck of memory allocated by <ACE_Shared_Memory_SV::malloc>.

Implements ACE_Shared_Memory.

Definition at line 71 of file Shared_Memory_SV.i.

References ACE_TRACE.

00072 {
00073   ACE_TRACE ("ACE_Shared_Memory_SV::free");
00074   return p != 0;
00075 }

ACE_INLINE ACE_HANDLE ACE_Shared_Memory_SV::get_id void    const [virtual]
 

Return the ID of the shared memory segment (i.e., a System V shared memory internal id).

Implements ACE_Shared_Memory.

Definition at line 56 of file Shared_Memory_SV.i.

References ACE_TRACE, ACE_SV_Shared_Memory::get_id, and shared_memory_.

00057 {
00058   ACE_TRACE ("ACE_Shared_Memory_SV::get_id");
00059   return this->shared_memory_.get_id ();
00060 }

ACE_INLINE int ACE_Shared_Memory_SV::get_segment_size void    const [virtual]
 

Return the size of the shared memory segment.

Implements ACE_Shared_Memory.

Definition at line 22 of file Shared_Memory_SV.i.

References ACE_TRACE.

00023 {
00024   ACE_TRACE ("ACE_Shared_Memory_SV::get_segment_size");
00025   // This cast is ok since the 'open' method for this class allows only
00026   // an 'int' size. Therefore, this case should not lose information.
00027   return ACE_static_cast (int, this->shared_memory_.get_segment_size ());
00028 }

ACE_INLINE void * ACE_Shared_Memory_SV::malloc size_t    = 0 [virtual]
 

Create a new chuck of memory containing <size> bytes.

Implements ACE_Shared_Memory.

Definition at line 49 of file Shared_Memory_SV.i.

References ACE_TRACE, ACE_SV_Shared_Memory::get_segment_ptr, and shared_memory_.

00050 {
00051   ACE_TRACE ("ACE_Shared_Memory_SV::malloc");
00052   return this->shared_memory_.get_segment_ptr ();
00053 }

ACE_INLINE int ACE_Shared_Memory_SV::open key_t    id,
int    length,
int    create = ACE_Shared_Memory_SV::ACE_OPEN,
int    perms = ACE_DEFAULT_FILE_PERMS,
void *    addr = 0,
int    flags = 0
 

Definition at line 7 of file Shared_Memory_SV.i.

References ACE_TRACE, ACE_SV_Shared_Memory::open_and_attach, and shared_memory_.

00013 {
00014   ACE_TRACE ("ACE_Shared_Memory_SV::open");
00015   return shared_memory_.open_and_attach (id, length, create, 
00016                                          perms, addr, flags);
00017 }

ACE_INLINE int ACE_Shared_Memory_SV::remove void    [virtual]
 

Remove the underlying shared memory segment.

Implements ACE_Shared_Memory.

Definition at line 33 of file Shared_Memory_SV.i.

References ACE_TRACE, ACE_SV_Shared_Memory::remove, and shared_memory_.

00034 {
00035   ACE_TRACE ("ACE_Shared_Memory_SV::remove");
00036   return shared_memory_.remove ();
00037 }


Member Data Documentation

ACE_Shared_Memory_SV::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 84 of file Shared_Memory_SV.h.

ACE_SV_Shared_Memory ACE_Shared_Memory_SV::shared_memory_ [private]
 

This version is implemented with System V shared memory segments.

Definition at line 89 of file Shared_Memory_SV.h.

Referenced by close, get_id, malloc, open, and remove.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:56:05 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002