Reference

corelinux_CoreLinuxGuardPool(3)

The CoreLinuxGuardPool is a private SemaphoreGroup resource for class objects that require synchronization capability.

NAME

corelinux::CoreLinuxGuardPool - The CoreLinuxGuardPool is a private SemaphoreGroup resource for class objects that require synchronization capability.

SYNOPSIS

#include <CoreLinuxGuardPool.hpp>

Public Member Functions

CoreLinuxGuardPool (Short numInit=8, Short numExt=0) throw ( Assertion )
Default constructor. virtual ~CoreLinuxGuardPool (void)
Virtual destructor.

Static Public Member Functions

bool isLocked (SynchronizedPtr) throw ( SemaphoreException )
isLocked determines if the object is currently locked. Short getInitialPoolSize (void)
Return the initial guard count in the pool. Short getExtentSize (void)
Return the current grow by count for the pool. Short getTotalCurrentSize (void)
Return the current guard pool size. void lock (SynchronizedPtr) throw ( SemaphoreException )
lock is called by a guard when control is needed over a objects resource access. void release (SynchronizedPtr) throw ( SemaphoreException )
release is called by a guard object during its destruction. void setExtentSize (Short aExtentSize) throw ( Assertion )
Run time interface for changing the extent size.

Protected Member Functions

bool isSynchronizedLocked (SynchronizedPtr) throw ( SemaphoreException )
isSynchronizedLocked resolves whether Synchronized is in a locked state. void lockSynchronized (SynchronizedPtr) throw ( SemaphoreException )
lockSynchronized manages the associations of objects to the semaphore in the pool in establishing the guard. void releaseSynchronized (SynchronizedPtr) throw ( SemaphoreException )
releaseSynchronized manages the associations of objects to the semaphore in the pool when releasing a guard. void createPoolGroup (Short numSems, Short initSize=0)
createPoolGroup creates a semaphore set with the requested number of semaphores in the group and will add the semaphores to theSemaphores with initial count and index set properly void destroyPoolGroup (Index aGroup)
destroyPoolGroup validates that all the semaphores in the extent are not being used and then destroys the extent and all the semaphores associated with it.

Static Protected Attributes

GuardPool theGuard
Singleton instance. Short theInitialSize
Describes the inital pool size. Short theExtentSize
Describes the size to add when going into extents.

Detailed Description

The CoreLinuxGuardPool is a private SemaphoreGroup resource for class objects that require synchronization capability.

See also:

corelinux::Synchronized, corelinux::PoolDescriptor

Constructor & Destructor Documentation

corelinux::CoreLinuxGuardPool::CoreLinuxGuardPool (Short numInit = 8, Short numExt = 0) throw ( Assertion )

Default constructor. Parameters:

Short number of base semaphores to use in pool
Short number of semaphores to increment by when going into extents. If 0, no extents are allowed.

Exceptions:

Assertion if Singleton<CoreLinuxGuardPool> already established.

Member Function Documentation

void corelinux::CoreLinuxGuardPool::createPoolGroup (Short numSems, Short initSize = 0) [protected]

createPoolGroup creates a semaphore set with the requested number of semaphores in the group and will add the semaphores to theSemaphores with initial count and index set properly Parameters:

Short the semaphore count
Short the number to insert into theSemaphores If the default is used, all go into theSemaphores

void corelinux::CoreLinuxGuardPool::destroyPoolGroup (Index aGroup) [protected]

destroyPoolGroup validates that all the semaphores in the extent are not being used and then destroys the extent and all the semaphores associated with it. The method assumes that the group is the last in the vector.

Parameters:

Index the group index

bool corelinux::CoreLinuxGuardPool::isLocked (SynchronizedPtr) throw ( SemaphoreException ) [static]

isLocked determines if the object is currently locked. Calls singleton instance isSynchronizedLocked.

Parameters:

Synchronized pointer of guard owner.

Returns:

bool true if locked

bool corelinux::CoreLinuxGuardPool::isSynchronizedLocked (SynchronizedPtr) throw ( SemaphoreException ) [protected]

isSynchronizedLocked resolves whether Synchronized is in a locked state. Parameters:

Synchronized pointer of guard owner.

Returns:

bool true if locked

Exceptions:

SemaphoreException if not of set.

void corelinux::CoreLinuxGuardPool::lock (SynchronizedPtr) throw ( SemaphoreException ) [static]

lock is called by a guard when control is needed over a objects resource access. Calls singleton instance lockedSynchronized.

Parameters:

Synchronized pointer of guard owner.

Exceptions:

SemaphoreException if out of pool resources

void corelinux::CoreLinuxGuardPool::lockSynchronized (SynchronizedPtr) throw ( SemaphoreException ) [protected]

lockSynchronized manages the associations of objects to the semaphore in the pool in establishing the guard. Parameters:

Synchronized pointer of guard owner.

void corelinux::CoreLinuxGuardPool::release (SynchronizedPtr) throw ( SemaphoreException ) [static]

release is called by a guard object during its destruction. Parameters:

Synchronized pointer of guard owner.Calls singleton instance releaseSynchronized.

Exceptions:

SemaphoreException if Synchronized object held no resource.

void corelinux::CoreLinuxGuardPool::releaseSynchronized (SynchronizedPtr) throw ( SemaphoreException ) [protected]

releaseSynchronized manages the associations of objects to the semaphore in the pool when releasing a guard. Parameters:

Synchronized pointer of guard owner.

void corelinux::CoreLinuxGuardPool::setExtentSize (Short aExtentSize) throw ( Assertion ) [static]

Run time interface for changing the extent size. The next time the pool goes into extent processing, this will be used.

Parameters:

short the new extent size

Exceptions:

Assertion if size < 0

Author

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

History