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

SharedMemory Class Reference

Shared memory. More...

#include <sharedMemory.h>

List of all members.

Public Methods

 SharedMemory (const String &name, int size)
 Constructor. More...

 ~SharedMemory ()
 Destructor. More...

void * getAddress ()
 Address of shared memory block. More...

int getSize ()
 Size of shared memory block. More...


Private Attributes

int _shmid
 unix shared memory identifier.

void * _address
 unix shared memory address.

int _size
 shared memory size.


Detailed Description

Shared memory.

This class manages IPC shared memory. Implementation of this class is platform/system dependent.

Author:
Marek Przeczek

Definition at line 46 of file sharedMemory.h.


Constructor & Destructor Documentation

SharedMemory::SharedMemory const String   name,
int    size
 

Constructor.

It attaches shared memory associated with given name. If shared memory doesn't exist yet, new shared block of memory is created and associated with given name.

Parameters:
name  name of shared block of memory
size  size of shared memory (in bytes)

Definition at line 38 of file sharedMemory.cpp.

SharedMemory::~SharedMemory  
 

Destructor.

It deattaches attached shared memory from the address space of the process. If possible, block of shared memory is destroyed.

Definition at line 53 of file sharedMemory.cpp.


Member Function Documentation

void* SharedMemory::getAddress   [inline]
 

Address of shared memory block.

This method returns a pointer where shared memory begins - is mapped to process' address space.

Returns:
pointer to shared memory block

Definition at line 89 of file sharedMemory.h.

Referenced by CommunShMem::initialize(), CommunShMem::operator<<(), CommunShMem::operator>>(), and CommunShMem::~CommunShMem().

int SharedMemory::getSize   [inline]
 

Size of shared memory block.

Returns:
size of shared memory block

Definition at line 95 of file sharedMemory.h.

Referenced by CommunShMem::operator<<(), and CommunShMem::operator>>().


The documentation for this class was generated from the following files:
Generated on Mon Jan 28 14:53:30 2002 for Java Profiler Dynamic Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001