---
name: "corelinux_CoreLinuxGuardGroup"
section: "3"
platform: "linux"
package: "libcorelinux-dev"
version: "0.4.32-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/corelinux_CoreLinuxGuardGroup"
---

# corelinux\_CoreLinuxGuardGroup(3)

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

## NAME

corelinux::CoreLinuxGuardGroup - A **CoreLinuxGuardGroup** is an extension to the **SemaphoreGroup** for creating semaphores for the **CoreLinuxGuardPool**.

## SYNOPSIS

`#include <CoreLinuxGuardGroup.hpp>`

Inherits **corelinux::SemaphoreGroup**.

### Public Member Functions

**CoreLinuxGuardGroup** (Short)  throw (Assertion,SemaphoreException)\
 *Default constructor creates a private group semaphores with access for OWNER\_ALL.*  virtual **~CoreLinuxGuardGroup** (void)\
 *Virtual destructor.*  virtual **AbstractSemaphorePtr** **createSemaphore** (void)  throw ( SemaphoreException )\
 *Create a default* **GuardSemaphore***.*  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***.*  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***.*  virtual void **destroySemaphore** (**AbstractSemaphorePtr**)  throw ( SemaphoreException )\
 *Destroys a created* **GuardSemaphore***.*

### 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.*

## Detailed Description

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

## Constructor & Destructor Documentation

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

Default constructor creates a private group semaphores with access for OWNER\_ALL. **Parameters:**

*Short* Number of semaphores in group

**Exceptions:**

*Assertion* if aCount \< 1 \
 *SemaphoreException* if kernel group create call fails.

**See also:**

**AccessRights**

## Member Function Documentation

### 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:**

*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

**Returns:**

**AbstractSemaphore** aSem - pointer to created or opened semaphore

**Exceptions:**

*SemaphoreException* if the disposition disagrees with the semaphore state, or if it is a erroneous identifier

Implements **corelinux::SemaphoreGroup**.

### 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:**

*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

**Returns:**

**AbstractSemaphore** aSem - pointer to created or opened semaphore

**Exceptions:**

*SemaphoreException* if the disposition disagrees with the semaphore state, or if it is a erroneous identifier

Implements **corelinux::SemaphoreGroup**.

### AbstractSemaphorePtr corelinux::CoreLinuxGuardGroup::createSemaphore (void) throw ( SemaphoreException )` [virtual]`

Create a default **GuardSemaphore**. **Returns:**

**AbstractSemaphore** aSem - pointer to created semaphore

**Exceptions:**

*SemaphoreException* if no sems left in group

Implements **corelinux::SemaphoreGroup**.

### void corelinux::CoreLinuxGuardGroup::destroySemaphore (AbstractSemaphorePtr) 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:**

*AbstractSemaphore* pointer of semaphore to destroy

**Exceptions:**

*SemaphoreException* if semaphore does not belong to this group or if already destroyed.

Implements **corelinux::SemaphoreGroup**.

## Author

Generated automatically by Doxygen for CoreLinux++ from the source code.
