BLOCXX_NAMESPACE::IPCMutex Class Reference

WARNING: This class only works on Linux. More...

#include <IPCMutex.hpp>

List of all members.

Public Member Functions

 IPCMutex (int semId)
 Construct an IPCMutex instance.
 ~IPCMutex ()
void wait ()
 Wait on the process semaphore.
void signal ()
 Signal the process semaphore.
int getId ()
 Get the process semaphore ID.

Static Public Member Functions

static void free (int semKey)
 Free the system resources associated with the process semaphore.

Private Attributes

int m_semid
struct sembuf m_sbuf
union
BLOCXX_NAMESPACE::IPCMutex::semun 
m_arg

Classes

union  semun


Detailed Description

WARNING: This class only works on Linux.

Also the tests are disabled. TODO: Fix it.

Definition at line 61 of file IPCMutex.hpp.


Constructor & Destructor Documentation

BLOCXX_NAMESPACE::IPCMutex::IPCMutex ( int  semId  ) 

Construct an IPCMutex instance.

The first time this ctor is called with a given semId, the process semaphore will be created. When the semaphore is no longer needed, IPCMutex::free() should be called with the same semId.

Parameters:
semId A unique identifier for the process mutex.
Exceptions:
IPCMutexException if unable to create a process semaphore

Definition at line 53 of file IPCMutex.cpp.

References BLOCXX_THROW, BLOCXX_THROW_ERRNO_MSG, m_arg, m_sbuf, m_semid, and BLOCXX_NAMESPACE::IPCMutex::semun::val.

BLOCXX_NAMESPACE::IPCMutex::~IPCMutex (  )  [inline]

Definition at line 75 of file IPCMutex.hpp.


Member Function Documentation

void BLOCXX_NAMESPACE::IPCMutex::wait (  ) 

Wait on the process semaphore.

Definition at line 78 of file IPCMutex.cpp.

References BLOCXX_NAMESPACE::BLOCK_FOR_KEY, BLOCXX_THROW_ERRNO_MSG, m_sbuf, and m_semid.

Referenced by BLOCXX_NAMESPACE::IPCMutexLock::IPCMutexLock().

void BLOCXX_NAMESPACE::IPCMutex::signal (  ) 

Signal the process semaphore.

Definition at line 90 of file IPCMutex.cpp.

References BLOCXX_NAMESPACE::ADD_KEY, BLOCXX_THROW_ERRNO_MSG, m_sbuf, and m_semid.

Referenced by BLOCXX_NAMESPACE::IPCMutexLock::~IPCMutexLock().

int BLOCXX_NAMESPACE::IPCMutex::getId (  )  [inline]

Get the process semaphore ID.

Returns:
The process semaphore ID

Definition at line 90 of file IPCMutex.hpp.

References m_semid.

void BLOCXX_NAMESPACE::IPCMutex::free ( int  semKey  )  [static]

Free the system resources associated with the process semaphore.

Parameters:
semKey The key to the process semaphore resources to free

Definition at line 103 of file IPCMutex.cpp.


Member Data Documentation

Definition at line 98 of file IPCMutex.hpp.

Referenced by getId(), IPCMutex(), signal(), and wait().

struct sembuf BLOCXX_NAMESPACE::IPCMutex::m_sbuf [read, private]

Definition at line 99 of file IPCMutex.hpp.

Referenced by IPCMutex(), signal(), and wait().

Referenced by IPCMutex().


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

Generated on Wed Feb 25 19:05:06 2009 for blocxx by  doxygen 1.5.6