CoreLinux++
0.4.32
|
A GatewaySemaphoreGroup is an extension to the SemaphoreGroup for creating only GatewaySemaphore types. More...
#include <GatewaySemaphoreGroup.hpp>
Public Member Functions | |
throw (Assertion, SemaphoreException) | |
Default constructor creates a private group semaphores with access for OWNER_ALL. More... | |
GatewaySemaphoreGroup (Short, SemaphoreGroupIdentifierCref, Int, CreateDisposition disp=FAIL_IF_EXISTS) throw (Assertion,SemaphoreException) | |
Constructor to open or create a semaphore group with a specific identifier. More... | |
GatewaySemaphoreGroup (Short, CharCptr aName, Int, CreateDisposition disp=FAIL_IF_EXISTS) throw (Assertion,SemaphoreException) | |
Constructor to open or create a semaphore group by name. More... | |
virtual | ~GatewaySemaphoreGroup (void) |
Virtual destructor. | |
virtual AbstractSemaphorePtr | createSemaphore (void) throw ( SemaphoreException ) |
Create a default GatewaySemaphore. More... | |
virtual AbstractSemaphorePtr | createCountSemaphore (Count aCount) throw ( SemaphoreException ) |
Create a count GatewaySemaphore. 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 GatewaySemphore. More... | |
virtual AbstractSemaphorePtr | createCountSemaphore (SemaphoreIdentifierRef aIdentifier, Count aCount, CreateDisposition disp=CREATE_OR_REUSE, bool Recursive=false, bool Balking=false) throw ( SemaphoreException ) |
Create or open (use) a specific GatewaySemphore and have it automatically initialized to the specified count. 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 GatewaySemphore. More... | |
virtual void | destroySemaphore (AbstractSemaphorePtr) throw ( SemaphoreException ) |
Destroys a created GatewaySemaphore. More... | |
![]() | |
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... | |
![]() | |
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 | |
GatewaySemaphoreGroup (void) throw ( Assertion ) | |
Default constructor not allowed. | |
throw (Assertion) | |
Copy constructor not allowed. | |
GatewaySemaphoreGroupRef | operator= (GatewaySemaphoreGroupCref) throw ( Assertion ) |
Assignment operator not allowed. | |
AbstractSemaphorePtr | resolveSemaphore (SemaphoreIdentifierRef aIdentifier, Short aSemId, CreateDisposition aDisp, bool aRecurse, bool aBalk, Count aMaxValue=1) throw ( SemaphoreException ) |
Protected method for resolving mutex between CSA and local. | |
![]() | |
SemaphoreGroup (void) throw ( Assertion ) | |
Default constructor not allowed. | |
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... | |
![]() | |
Guard | access (void) const throw (SemaphoreException) |
Access returns a instance of Guard which is block scoped to the caller. More... | |
Additional Inherited Members | |
![]() | |
typedef Guard * | GuardPtr |
typedef const Guard * | GuardCptr |
typedef Guard & | GuardRef |
typedef const Guard & | GuardCref |
A GatewaySemaphoreGroup is an extension to the SemaphoreGroup for creating only GatewaySemaphore types.
Default behavior for creating semaphores via the SemaphoreGroup interface is to create a Gateway and initialize it to a count of two (2) Use the createCountSemaphore(...) interface to accomplish initializing the GatewaySemaphore to a count > 2.
corelinux::GatewaySemaphoreGroup::GatewaySemaphoreGroup | ( | Short | aSemCount, |
SemaphoreGroupIdentifierCref | aGID, | ||
Int | aRightSet, | ||
CreateDisposition | disp = FAIL_IF_EXISTS |
||
) | |||
throw | ( | Assertion, | |
SemaphoreException | |||
) |
Constructor to open or create a semaphore group with a specific identifier.
Short | Number of semaphores in group, this only has meaning used if failOnExist = true |
SemaphoreGroupIdentifier | valid group identifier either through a system call or via another ipc mechanism |
AccessRights | Specifies access control for group |
CreateDisposition | indicates 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 |
Assertion | if aCount < 1 |
SemaphoreException | for described states |
corelinux::GatewaySemaphoreGroup::GatewaySemaphoreGroup | ( | Short | aSemCount, |
CharCptr | aName, | ||
Int | aRightSet, | ||
CreateDisposition | disp = FAIL_IF_EXISTS |
||
) | |||
throw | ( | Assertion, | |
SemaphoreException | |||
) |
Constructor to open or create a semaphore group by name.
Short | Number of semaphores in group, this only has meaning used if failOnExist = true |
Char | pointer to Group name |
AccessRights | Specifies access control for group |
CreateDisposition | indicates 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 |
Assertion | if aCount < 1 or aCount > system defined maximum for group |
SemaphoreException | for described states |
|
virtual |
Create a count GatewaySemaphore.
Count | initializing count for GatewaySemaphore |
SemaphoreException | if no sems left in group |
References corelinux::DEFAULT_COUNT(), and corelinux::FAIL_IF_EXISTS.
|
virtual |
Create or open (use) a specific GatewaySemphore and have it automatically initialized to the specified count.
SemaphoreIdentifier | identifies which semphore id to create or attempt to use |
Count | initializing count for GatewaySemaphore |
CreateDisposition | indicates 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 |
Recursive | to allow same thread multiple locks |
Balking | to allow the semaphore to balk |
SemaphoreException | if the disposition disagrees with the semaphore state, or if it is a erroneous identifier |
References corelinux::DEFAULT_COUNT(), and corelinux::ScalarIdentifier< ScalarType >::getScalar().
|
virtual |
Create a default GatewaySemaphore.
SemaphoreException | if no sems left in group |
Implements corelinux::SemaphoreGroup.
References corelinux::DEFAULT_COUNT(), corelinux::FAIL_IF_EXISTS, and resolveSemaphore().
|
virtual |
Create or open (use) a specific GatewaySemphore.
SemaphoreIdentifier | identifies which semphore id to create or attempt to use |
CreateDisposition | indicates 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 |
Recursive | to allow same thread multiple locks |
Balking | to allow the semaphore to balk |
SemaphoreException | if the disposition disagrees with the semaphore state, or if it is a erroneous identifier |
Implements corelinux::SemaphoreGroup.
References corelinux::DEFAULT_COUNT(), and corelinux::ScalarIdentifier< ScalarType >::getScalar().
|
virtual |
Create or open (use) a specific GatewaySemphore.
string | identifies which semphore id to create or attempt to use |
CreateDisposition | indicates 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 |
Recursive | to allow same thread multiple locks |
Balking | to allow the semaphore to balk |
SemaphoreException | if the disposition disagrees with the semaphore state, or if it is a erroneous identifier |
Implements corelinux::SemaphoreGroup.
|
virtual |
Destroys a created GatewaySemaphore.
AbstractSemaphore | pointer of semaphore to destroy |
SemaphoreException | if semaphore does not belong to this group or if already destroyed. |
Implements corelinux::SemaphoreGroup.
References corelinux::SemaphoreCommon::relinquishSemaphore().
corelinux::GatewaySemaphoreGroup::throw | ( | Assertion | , |
SemaphoreException | |||
) |
Default constructor creates a private group semaphores with access for OWNER_ALL.
Short | Number of semaphores in group |
AccessRights | Specifies access control for group |
Assertion | if aCount < 1 |
SemaphoreException | if kernel group create call fails. |