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

Represents a public semaphore, the semaphore data is located in shared memory. More...

#include <esynch.h>

Inheritance diagram for ESemaphorePublic:
ESemaphoreBase

Public Member Functions

 ESemaphorePublic ()
 Default constructor. More...
 
 ESemaphorePublic (Long initcnt, Bool bInit=True)
 Class constructor. More...
 
 ~ESemaphorePublic ()
 Class destructor. More...
 
Void init (Long initialCount)
 Initializes the data associated with the semaphore. More...
 
Void destroy ()
 Destroys the data associated with the semaphore. More...
 
Int & semIndex ()
 Retrieves the semaphore data index. More...
 
Void attach (Int semid)
 Attaches this object to the semaphore data associated with the semaphore ID. More...
 
Void detach ()
 Detaches from the semaphore data. More...
 
- Public Member Functions inherited from ESemaphoreBase
 ESemaphoreBase ()
 Default constructor. More...
 
 ~ESemaphoreBase ()
 Class desctructor. 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...
 

Friends

class ESynchObjects
 

Detailed Description

Represents a public semaphore, the semaphore data is located in shared memory.

Constructor & Destructor Documentation

◆ ESemaphorePublic() [1/2]

ESemaphorePublic::ESemaphorePublic ( )
inline

Default constructor.

◆ ESemaphorePublic() [2/2]

ESemaphorePublic::ESemaphorePublic ( Long  initcnt,
Bool  bInit = True 
)
inline

Class constructor.

Parameters
initcntthe initial count for the semaphore.
bInitdirects the constructor to initialize the semaphore.

◆ ~ESemaphorePublic()

ESemaphorePublic::~ESemaphorePublic ( )
inline

Class destructor.

Member Function Documentation

◆ attach()

Void ESemaphorePublic::attach ( Int  semid)

Attaches this object to the semaphore data associated with the semaphore ID.

Parameters
semidthe semaphore ID.

◆ destroy()

Void ESemaphorePublic::destroy ( )
virtual

Destroys the data associated with the semaphore.

Implements ESemaphoreBase.

◆ detach()

Void ESemaphorePublic::detach ( )

Detaches from the semaphore data.

◆ init()

Void ESemaphorePublic::init ( Long  initialCount)
virtual

Initializes the data associated with the semaphore.

Parameters
initialCountthe initial count for the semaphore.

Implements ESemaphoreBase.

◆ semIndex()

Int & ESemaphorePublic::semIndex ( )

Retrieves the semaphore data index.

Returns
reference to the semaphore data index.

Friends And Related Function Documentation

◆ ESynchObjects

friend class ESynchObjects
friend

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