EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
ESemaphoreBase Class Referenceabstract

Contains the base functionality for a semaphore. More...

#include <esynch.h>

Inheritance diagram for ESemaphoreBase:
ESemaphorePrivate ESemaphorePublic

Public Member Functions

 ESemaphoreBase ()
 Default constructor. More...
 
 ~ESemaphoreBase ()
 Class desctructor. More...
 
virtual Void init (Long initcnt)=0
 Initializes the semaphore data. This method must be overloaded in a derived class. More...
 
virtual Void destroy ()=0
 Destroys/releases the semaphore data. This method must be overloaded in a derived class. More...
 
Bool Decrement (Bool wait=True)
 Decrements the semaphore value. More...
 
Bool Increment ()
 Increments the semaphore value. More...
 
Bool initialized ()
 Indicates the initialization status for this object. More...
 
Bool & shared ()
 Indicates if this object is to be shared between processes. More...
 
Long & initialCount ()
 Retrieves the initial semaphore value. More...
 
Long currCount ()
 Retrieves the current semaphore value. More...
 
 operator ESemaphoreData & ()
 Retrieves a reference to the underlying semaphore data. More...
 

Detailed Description

Contains the base functionality for a semaphore.

Constructor & Destructor Documentation

◆ ESemaphoreBase()

ESemaphoreBase::ESemaphoreBase ( )
inline

Default constructor.

◆ ~ESemaphoreBase()

ESemaphoreBase::~ESemaphoreBase ( )
inline

Class desctructor.

Member Function Documentation

◆ currCount()

Long ESemaphoreBase::currCount ( )
inline

Retrieves the current semaphore value.

Returns
the current semaphore value.

◆ Decrement()

Bool ESemaphoreBase::Decrement ( Bool  wait = True)
inline

Decrements the semaphore value.

Parameters
waitindicates if the this method will block until the semaphore value is greater than zero.
Returns
True indicates that the semaphore value was successfully decremented, otherwise False.

◆ destroy()

virtual Void ESemaphoreBase::destroy ( )
pure virtual

Destroys/releases the semaphore data. This method must be overloaded in a derived class.

Implemented in ESemaphorePublic, and ESemaphorePrivate.

◆ Increment()

Bool ESemaphoreBase::Increment ( )
inline

Increments the semaphore value.

Returns
True indicates that the semaphore value was successfully decremented, otherwise False.

◆ init()

virtual Void ESemaphoreBase::init ( Long  initcnt)
pure virtual

Initializes the semaphore data. This method must be overloaded in a derived class.

Parameters
initcntthe initial count for the semaphore.

Implemented in ESemaphorePublic, and ESemaphorePrivate.

◆ initialCount()

Long& ESemaphoreBase::initialCount ( )
inline

Retrieves the initial semaphore value.

Returns
the initial semaphore value.

◆ initialized()

Bool ESemaphoreBase::initialized ( )
inline

Indicates the initialization status for this object.

Returns
True indicates the object is initialized, otherwise False.

◆ operator ESemaphoreData &()

ESemaphoreBase::operator ESemaphoreData & ( )
inline

Retrieves a reference to the underlying semaphore data.

Returns
a reference to the underlying semaphore data.

◆ shared()

Bool& ESemaphoreBase::shared ( )
inline

Indicates if this object is to be shared between processes.

Returns
True semaphore is to be shared, otherwise False.

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