QSharedMemory Class Reference

Inheritance diagram for QSharedMemory:

QGuiSharedMemory

List of all members.


Detailed Description

abstract class implementing basic functionalities to access shared memories

Author:
Sergio Di Domizio

Public Member Functions

 QSharedMemory ()
 ctor
virtual ~QSharedMemory ()
 dtor
const QErrorGetError () const
 get QError generated in the last operation

Protected Member Functions

virtual bool Init (bool owner, int shmId)=0
bool IsOwner () const
void *const GetShmPointer ()
 get pointer to shared memory segment
bool InitInternal (bool owner, int shmId, int shmSize)
 perform shared memory intialization

Protected Attributes

QError fError

Private Attributes

int fHandle
bool fOwner
void * fPointer

Constructor & Destructor Documentation

QSharedMemory::~QSharedMemory (  )  [virtual]

dtor

detaches from shared memory and deletes it if has ownership

References fHandle, fOwner, and fPointer.


Member Function Documentation

virtual bool QSharedMemory::Init ( bool  owner,
int  shmId 
) [protected, pure virtual]

In this method the child classes should perform a cast from void* to the true type of the object that will be stored in the shared memory

Implemented in QGuiSharedMemory.

void* const QSharedMemory::GetShmPointer (  )  [inline, protected]

get pointer to shared memory segment

Used to perform proper casting in the child classes

References fPointer.

Referenced by QGuiSharedMemory::Init().

bool QSharedMemory::InitInternal ( bool  owner,
int  shmId,
int  shmSize 
) [protected]

perform shared memory intialization

Parameters:
owner whether this object is the owner of the shared memory
shmId the id of the target shared memory
shmSize size of the shared memory segment in bytes
The new shared memory will point to fPointer;

References fHandle, fOwner, fPointer, and QError::Set().

Referenced by QGuiSharedMemory::Init().


Member Data Documentation

int QSharedMemory::fHandle [private]

shared memory handler

Referenced by InitInternal(), and ~QSharedMemory().

bool QSharedMemory::fOwner [private]

whether this object is the owner of the shared memory

Referenced by InitInternal(), and ~QSharedMemory().

void* QSharedMemory::fPointer [private]

pointer to shared memory segment

Referenced by GetShmPointer(), InitInternal(), and ~QSharedMemory().


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

Generated on Tue Nov 16 10:50:08 2010 for CUORE Software by  doxygen 1.5.6