CoreLinux++  0.4.32
Public Member Functions | Protected Member Functions | List of all members
corelinux::CoreLinuxGuardGroup Class Reference

A CoreLinuxGuardGroup is an extension to the SemaphoreGroup for creating semaphores for the CoreLinuxGuardPool. More...

#include <CoreLinuxGuardGroup.hpp>

Public Member Functions

 CoreLinuxGuardGroup (Short) throw (Assertion,SemaphoreException)
 Default constructor creates a private group semaphores with access for OWNER_ALL. More...
 
virtual ~CoreLinuxGuardGroup (void)
 Virtual destructor.
 
virtual AbstractSemaphorePtr createSemaphore (void) throw ( SemaphoreException )
 Create a default GuardSemaphore. More...
 
virtual AbstractSemaphorePtr createSemaphore (SemaphoreIdentifierRef aIdentifier, CreateDisposition disp=CREATE_OR_REUSE, bool Recursive=false, bool Balking=false) throw ( SemaphoreException )
 Create or open (use) a specific GuardSemaphore. More...
 
virtual AbstractSemaphorePtr createSemaphore (std::string aName, CreateDisposition disp=CREATE_OR_REUSE, bool Recursive=false, bool Balking=false) throw ( SemaphoreException )
 Create or open (use) a specific GuardSemaphore. More...
 
virtual void destroySemaphore (AbstractSemaphorePtr) throw ( SemaphoreException )
 Destroys a created GuardSemaphore. More...
 
- Public Member Functions inherited from corelinux::SemaphoreGroup
 SemaphoreGroup (Short, Int Rights=OWNER_ALL) throw (Assertion,SemaphoreException)
 Default constructor creates a private group semaphores. More...
 
 SemaphoreGroup (Short, SemaphoreGroupIdentifierCref, Int, CreateDisposition disp=FAIL_IF_EXISTS) throw (Assertion,SemaphoreException)
 Constructor to open or create a semaphore group with a specific identifier. More...
 
 SemaphoreGroup (Short, CharCptr, Int, CreateDisposition disp=FAIL_IF_EXISTS) throw (Assertion,SemaphoreException)
 Constructor to open or create a semaphore group by name. More...
 
virtual ~SemaphoreGroup (void)
 Virtual destructor.
 
bool operator== (SemaphoreGroupCref) const
 Equality operator compares the identifier. More...
 
Short getSemaphoreCount (void) const
 Return the number of semaphores in the group. More...
 
SemaphoreGroupIdentifierCref getIdentifier (void) const
 Return the SemaphoreGroupIdentifier. More...
 
- Public Member Functions inherited from corelinux::Synchronized
 Synchronized (void)
 Default constructor.
 
 Synchronized (SynchronizedCref)
 Copy constructor.
 
virtual ~Synchronized (void)
 Virtual Destructor.
 
SynchronizedRef operator= (SynchronizedCref)
 Assignment operator.
 
bool operator== (SynchronizedCref) const
 Equality operator.
 

Protected Member Functions

 CoreLinuxGuardGroup (void) throw ( Assertion )
 Default constructor not allowed.
 
 CoreLinuxGuardGroup (CoreLinuxGuardGroupCref) throw ( Assertion )
 Copy constructor not allowed.
 
CoreLinuxGuardGroupRef operator= (CoreLinuxGuardGroupCref) throw ( Assertion )
 Assignment operator not allowed.
 
- Protected Member Functions inherited from corelinux::SemaphoreGroup
 SemaphoreGroup (void) throw ( Assertion )
 Default constructor not allowed.
 
 SemaphoreGroup (SemaphoreGroupCref) throw ( Assertion )
 Copy constructor not allowed.
 
SemaphoreGroupRef operator= (SemaphoreGroupCref) throw ( Assertion )
 Assignment operator not allowed.
 
void setGroupType (IntCref) const
 This indirects to CSA for non-private group types. More...
 
bool isPrivate (void) const
 Claim an unused semaphore from the group. More...
 
- Protected Member Functions inherited from corelinux::Synchronized
Guard access (void) const throw (SemaphoreException)
 Access returns a instance of Guard which is block scoped to the caller. More...
 

Additional Inherited Members

- Protected Types inherited from corelinux::Synchronized
typedef GuardGuardPtr
 
typedef const GuardGuardCptr
 
typedef GuardGuardRef
 
typedef const GuardGuardCref
 

Detailed Description

A CoreLinuxGuardGroup is an extension to the SemaphoreGroup for creating semaphores for the CoreLinuxGuardPool.

Constructor & Destructor Documentation

corelinux::CoreLinuxGuardGroup::CoreLinuxGuardGroup ( Short  aSemCount)
throw (Assertion,
SemaphoreException
)

Default constructor creates a private group semaphores with access for OWNER_ALL.

Parameters
ShortNumber of semaphores in group
Exceptions
Assertionif aCount < 1
SemaphoreExceptionif kernel group create call fails.
See also
AccessRights

Member Function Documentation

AbstractSemaphorePtr corelinux::CoreLinuxGuardGroup::createSemaphore ( void  )
throw (SemaphoreException
)
virtual

Create a default GuardSemaphore.

Returns
AbstractSemaphore aSem - pointer to created semaphore
Exceptions
SemaphoreExceptionif no sems left in group

Implements corelinux::SemaphoreGroup.

References corelinux::SemaphoreGroup::getSemaphoreCount().

Referenced by corelinux::CoreLinuxGuardPool::createPoolGroup().

AbstractSemaphorePtr corelinux::CoreLinuxGuardGroup::createSemaphore ( SemaphoreIdentifierRef  aIdentifier,
CreateDisposition  disp = CREATE_OR_REUSE,
bool  Recursive = false,
bool  Balking = false 
)
throw (SemaphoreException
)
virtual

Create or open (use) a specific GuardSemaphore.

Parameters
SemaphoreIdentifieridentifies which semphore id to create or attempt to use
CreateDispositionindicates how to treat the conditions that the group may meet in the request: CREATE_OR_REUSE indicates that the caller doesn't care FAIL_IF_EXISTS indicates the attempt was for a create FAIL_IF_NOTEXISTS indicates the attempt was for a open
Recursiveto allow same thread multiple locks
Balkingto allow the semaphore to balk
Returns
AbstractSemaphore aSem - pointer to created or opened semaphore
Exceptions
SemaphoreExceptionif the disposition disagrees with the semaphore state, or if it is a erroneous identifier

Implements corelinux::SemaphoreGroup.

References corelinux::FAIL_IF_EXISTS, corelinux::FAIL_IF_NOTEXISTS, and corelinux::ScalarIdentifier< ScalarType >::getScalar().

AbstractSemaphorePtr corelinux::CoreLinuxGuardGroup::createSemaphore ( std::string  aName,
CreateDisposition  disp = CREATE_OR_REUSE,
bool  Recursive = false,
bool  Balking = false 
)
throw (SemaphoreException
)
virtual

Create or open (use) a specific GuardSemaphore.

Parameters
stringidentifies which semphore id to create or attempt to use
CreateDispositionindicates how to treat the conditions that the group may meet in the request: CREATE_OR_REUSE indicates that the caller doesn't care FAIL_IF_EXISTS indicates the attempt was for a create FAIL_IF_NOTEXISTS indicates the attempt was for a open
Recursiveto allow same thread multiple locks
Balkingto allow the semaphore to balk
Returns
AbstractSemaphore aSem - pointer to created or opened semaphore
Exceptions
SemaphoreExceptionif the disposition disagrees with the semaphore state, or if it is a erroneous identifier

Implements corelinux::SemaphoreGroup.

void corelinux::CoreLinuxGuardGroup::destroySemaphore ( AbstractSemaphorePtr  aPtr)
throw (SemaphoreException
)
virtual

Destroys a created GuardSemaphore.

Note
Reference counting is not enabled so applications should ensure that only one (1) destroy is called per semaphore.
Parameters
AbstractSemaphorepointer of semaphore to destroy
Exceptions
SemaphoreExceptionif semaphore does not belong to this group or if already destroyed.

Implements corelinux::SemaphoreGroup.


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

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium