ACE 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
ACE_Shared_Memory_MM Class Reference

Shared memory wrapper based on MMAP. More...

#include <Shared_Memory_MM.h>

Inheritance diagram for ACE_Shared_Memory_MM:
Inheritance graph
[legend]
Collaboration diagram for ACE_Shared_Memory_MM:
Collaboration graph
[legend]

Public Member Functions

 ACE_Shared_Memory_MM ()
 Default constructor.
 
 ACE_Shared_Memory_MM (ACE_HANDLE handle, size_t length=static_cast< size_t >(-1), int prot=PROT_RDWR, int share=ACE_MAP_PRIVATE, char *addr=0, ACE_OFF_T pos=0)
 Constructor.
 
 ACE_Shared_Memory_MM (const ACE_TCHAR *file_name, size_t length=static_cast< size_t >(-1), int flags=O_RDWR|O_CREAT, int mode=ACE_DEFAULT_FILE_PERMS, int prot=PROT_RDWR, int share=ACE_MAP_SHARED, char *addr=0, ACE_OFF_T pos=0)
 Constructor.
 
int open (ACE_HANDLE handle, size_t length=static_cast< size_t >(-1), int prot=PROT_RDWR, int share=ACE_MAP_PRIVATE, char *addr=0, ACE_OFF_T pos=0)
 Open method.
 
int open (const ACE_TCHAR *file_name, size_t length=static_cast< size_t >(-1), int flags=O_RDWR|O_CREAT, int mode=ACE_DEFAULT_FILE_PERMS, int prot=PROT_RDWR, int share=ACE_MAP_SHARED, char *addr=0, ACE_OFF_T pos=0)
 Open method.
 
const ACE_TCHARfilename () const
 Return the name of file that is mapped (if any).
 
virtual int close ()
 Close down the shared memory segment.
 
virtual int remove ()
 Remove the shared memory segment and the underlying file.
 
virtual voidmalloc (size_t size=0)
 Create a new chuck of memory containing size bytes.
 
virtual int free (void *p)
 
virtual size_t get_segment_size () const
 Return the size of the shared memory segment.
 
virtual ACE_HANDLE get_id () const
 Return the ID of the shared memory segment (i.e., an ACE_HANDLE).
 
void dump () const
 Dump the state of an object.
 
- Public Member Functions inherited from ACE_Shared_Memory
virtual ~ACE_Shared_Memory ()
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Private Attributes

ACE_Mem_Map shared_memory_
 This version is implemented with memory-mapped files.
 

Detailed Description

Shared memory wrapper based on MMAP.

This class provides a very simple-minded shared memory manager. We strongly recommend that you do NOT use this class. Instead, please use ACE_Malloc, which has much more powerful capabilities.

Constructor & Destructor Documentation

◆ ACE_Shared_Memory_MM() [1/3]

ACE_Shared_Memory_MM::ACE_Shared_Memory_MM ( )

Default constructor.

The "do-nothing" constructor.

◆ ACE_Shared_Memory_MM() [2/3]

ACE_Shared_Memory_MM::ACE_Shared_Memory_MM ( ACE_HANDLE handle,
size_t length = static_cast<size_t> (-1),
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
char * addr = 0,
ACE_OFF_T pos = 0 )

Constructor.

Creates a shared memory segment of SIZE bytes.

◆ ACE_Shared_Memory_MM() [3/3]

ACE_Shared_Memory_MM::ACE_Shared_Memory_MM ( const ACE_TCHAR * file_name,
size_t length = static_cast<size_t> (-1),
int flags = O_RDWR | O_CREAT,
int mode = ACE_DEFAULT_FILE_PERMS,
int prot = PROT_RDWR,
int share = ACE_MAP_SHARED,
char * addr = 0,
ACE_OFF_T pos = 0 )

Constructor.

Member Function Documentation

◆ close()

int ACE_Shared_Memory_MM::close ( )
virtual

Close down the shared memory segment.

Closes (unmaps) the shared memory segment.

Implements ACE_Shared_Memory.

◆ dump()

void ACE_Shared_Memory_MM::dump ( ) const

Dump the state of an object.

◆ filename()

const ACE_TCHAR * ACE_Shared_Memory_MM::filename ( ) const
inline

Return the name of file that is mapped (if any).

◆ free()

int ACE_Shared_Memory_MM::free ( void * p)
virtual

Free a chuck of memory allocated by ACE_Shared_Memory_MM::malloc.

Implements ACE_Shared_Memory.

◆ get_id()

ACE_HANDLE ACE_Shared_Memory_MM::get_id ( ) const
virtual

Return the ID of the shared memory segment (i.e., an ACE_HANDLE).

Implements ACE_Shared_Memory.

◆ get_segment_size()

size_t ACE_Shared_Memory_MM::get_segment_size ( ) const
virtual

Return the size of the shared memory segment.

The overall size of the segment.

Implements ACE_Shared_Memory.

◆ malloc()

void * ACE_Shared_Memory_MM::malloc ( size_t size = 0)
virtual

Create a new chuck of memory containing size bytes.

Implements ACE_Shared_Memory.

◆ open() [1/2]

int ACE_Shared_Memory_MM::open ( ACE_HANDLE handle,
size_t length = static_cast<size_t> (-1),
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
char * addr = 0,
ACE_OFF_T pos = 0 )
inline

Open method.

◆ open() [2/2]

int ACE_Shared_Memory_MM::open ( const ACE_TCHAR * file_name,
size_t length = static_cast<size_t> (-1),
int flags = O_RDWR | O_CREAT,
int mode = ACE_DEFAULT_FILE_PERMS,
int prot = PROT_RDWR,
int share = ACE_MAP_SHARED,
char * addr = 0,
ACE_OFF_T pos = 0 )
inline

Open method.

◆ remove()

int ACE_Shared_Memory_MM::remove ( )
virtual

Remove the shared memory segment and the underlying file.

Unmaps the shared memory segment.

Implements ACE_Shared_Memory.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_Shared_Memory_MM::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ shared_memory_

ACE_Mem_Map ACE_Shared_Memory_MM::shared_memory_
private

This version is implemented with memory-mapped files.


The documentation for this class was generated from the following files: