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

IPC::SemSet Class Reference

System V IPC semaphore set. More...

#include <ipcplus.h>

List of all members.

Public Methods

 SemSet (const unsigned int key, const int num=5, const bool createIfNotExist=true)
 Constructor, creates a non-private IPC semaphore set. More...

virtual ~SemSet ()
 Destructor.

int numSem (void)
 Returns the number of semaphores in this set. More...

virtual bool destroy ()
 Destroy the actual IPC semaphore set. More...

bool semOp (const int semIdx, const int semOperation)
 Perform an operation on a single semaphore in the set. More...


Private Attributes

int sid
 The Sys V IPC semaphore id.

int numSemaphores
 The number of semaphores represented by the id above.


Detailed Description

System V IPC semaphore set.


Constructor & Destructor Documentation

IPC::SemSet::SemSet const unsigned int    key,
const int    num = 5,
const bool    createIfNotExist = true
 

Constructor, creates a non-private IPC semaphore set.

Parameters:
key  This is the "name" of the set. By using the same value, different processes can obtain access to the same semaphore set. Obviously, some method must be deployed to both insure that this key is unique in the system's shared semaphore space as well as known to those processes that wish to share semaphores. See ftok() for one possible method to determine such a key value.
num  The (arbitrary) default is to construct 5 semaphores. Consult your system documentation for limits on the maximum number of semaphores in a set or system-wide limits.
createIfNotExist  Should be pretty evident.


Member Function Documentation

bool IPC::SemSet::destroy   [virtual]
 

Destroy the actual IPC semaphore set.

Returns:
False if the destroy operation returned an error.

int IPC::SemSet::numSem void    [inline]
 

Returns the number of semaphores in this set.

Returns:
The number of semaphores in this set (== maximum semIdx + 1).

bool IPC::SemSet::semOp const int    semIdx,
const int    semOperation
 

Perform an operation on a single semaphore in the set.

Parameters:
semIdx  The index number of the semaphore.
semOp  The operation to perform. See also man semop.
Returns:
False if an error occurred.


The documentation for this class was generated from the following files:
Generated on Wed May 15 09:33:33 2002 for IPCPlus by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001