ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbSEM Class Reference

#include <ngcbTHREAD.hpp>

Inheritance diagram for ngcbSEM:
ngcbSEMC

Public Member Functions

 ngcbSEM ()
 Constructor.
 
 ngcbSEM (unsigned int count)
 Constructor for fast semaphore with initial count.
 
 ngcbSEM (unsigned int count, int check)
 Constructor with initial count and type (error checking on or off)
 
virtual ~ngcbSEM ()
 Destructor.
 
int Create (ngcbSEM_T *sp, unsigned int count, int check, char *erms=NULL)
 Create a semaphore of given type (error checking on or off)
 
int Create (ngcbSEM_T *sp, unsigned int count, char *erms=NULL)
 Create a fast semaphore.
 
int Destroy (ngcbSEM_T *sp, char *erms=NULL)
 Destroy a semaphore.
 
int Lock (ngcbSEM_T *sp)
 Lock a sempahore.
 
int Unlock (ngcbSEM_T *sp)
 Unlock a semaphore.
 
int TryLock (ngcbSEM_T *sp)
 Try to lock a semaphore.
 
int Post (ngcbSEM_T *sp)
 Post a semaphore.
 
int Set (ngcbSEM_T *sp, unsigned int cnt)
 Set semaphore counter.
 
size_t WaitCnt (ngcbSEM_T *sp, size_t cnt)
 Wait until counter is reached exactly or becomes zereo.
 
int Wait (ngcbSEM_T *sp)
 Wait for a semaphore.
 
int TryWait (ngcbSEM_T *sp)
 Try to wait for a semaphore.
 
size_t Cnt (ngcbSEM_T *sp)
 Get actual value of a semaphore counter.
 
int Lock ()
 Lock this semaphore.
 
int Unlock ()
 Unlock this semaphore.
 
int TryLock ()
 Try to lock this semaphore.
 
int Post ()
 Post this semaphore.
 
int Set (unsigned int cnt)
 Set this semaphore counter.
 
size_t WaitCnt (size_t cnt)
 Wait until counter in this semaphore is reached exactly or becomes zero.
 
int Wait ()
 Wait for this semaphore.
 
int TryWait ()
 Try to wait for this semaphore.
 
size_t Cnt ()
 Get actual value of this semaphore counter.
 

Detailed Description

Semaphore class

Constructor & Destructor Documentation

◆ ngcbSEM() [1/3]

ngcbSEM::ngcbSEM ( )

Constructor.

◆ ngcbSEM() [2/3]

ngcbSEM::ngcbSEM ( unsigned int count)
explicit

Constructor for fast semaphore with initial count.

◆ ngcbSEM() [3/3]

ngcbSEM::ngcbSEM ( unsigned int count,
int check )

Constructor with initial count and type (error checking on or off)

◆ ~ngcbSEM()

ngcbSEM::~ngcbSEM ( )
virtual

Destructor.

Member Function Documentation

◆ Cnt() [1/2]

size_t ngcbSEM::Cnt ( )

Get actual value of this semaphore counter.

◆ Cnt() [2/2]

size_t ngcbSEM::Cnt ( ngcbSEM_T * sp)

Get actual value of a semaphore counter.

◆ Create() [1/2]

int ngcbSEM::Create ( ngcbSEM_T * sp,
unsigned int count,
char * erms = NULL )

Create a fast semaphore.

◆ Create() [2/2]

int ngcbSEM::Create ( ngcbSEM_T * sp,
unsigned int count,
int check,
char * erms = NULL )

Create a semaphore of given type (error checking on or off)

◆ Destroy()

int ngcbSEM::Destroy ( ngcbSEM_T * sp,
char * erms = NULL )

Destroy a semaphore.

◆ Lock() [1/2]

int ngcbSEM::Lock ( )

Lock this semaphore.

◆ Lock() [2/2]

int ngcbSEM::Lock ( ngcbSEM_T * sp)

Lock a sempahore.

◆ Post() [1/2]

int ngcbSEM::Post ( )

Post this semaphore.

◆ Post() [2/2]

int ngcbSEM::Post ( ngcbSEM_T * sp)

Post a semaphore.

◆ Set() [1/2]

int ngcbSEM::Set ( ngcbSEM_T * sp,
unsigned int cnt )

Set semaphore counter.

◆ Set() [2/2]

int ngcbSEM::Set ( unsigned int cnt)

Set this semaphore counter.

◆ TryLock() [1/2]

int ngcbSEM::TryLock ( )

Try to lock this semaphore.

◆ TryLock() [2/2]

int ngcbSEM::TryLock ( ngcbSEM_T * sp)

Try to lock a semaphore.

◆ TryWait() [1/2]

int ngcbSEM::TryWait ( )

Try to wait for this semaphore.

◆ TryWait() [2/2]

int ngcbSEM::TryWait ( ngcbSEM_T * sp)

Try to wait for a semaphore.

◆ Unlock() [1/2]

int ngcbSEM::Unlock ( )

Unlock this semaphore.

◆ Unlock() [2/2]

int ngcbSEM::Unlock ( ngcbSEM_T * sp)

Unlock a semaphore.

◆ Wait() [1/2]

int ngcbSEM::Wait ( )

Wait for this semaphore.

◆ Wait() [2/2]

int ngcbSEM::Wait ( ngcbSEM_T * sp)

Wait for a semaphore.

◆ WaitCnt() [1/2]

size_t ngcbSEM::WaitCnt ( ngcbSEM_T * sp,
size_t cnt )

Wait until counter is reached exactly or becomes zereo.

◆ WaitCnt() [2/2]

size_t ngcbSEM::WaitCnt ( size_t cnt)

Wait until counter in this semaphore is reached exactly or becomes zero.


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