Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
xsens::Semaphore Class Reference

A semaphore class. More...

#include <xsens_mutex.h>

Public Member Functions

int32_t post (int32_t increment=1) noexcept
 Increases the count of the specified semaphore object by a specified amount. More...
 
 Semaphore (int32_t initVal=0, uint32_t nofOtherHandles=0, sem_t *otherHandles=NULL)
 Constructor. More...
 
bool wait1 ()
 Waits for an infinite time or until the semaphore is released. More...
 
bool wait1 (uint32_t timeout)
 Waits until time-out interval elapses or until the semaphore is released. More...
 
 ~Semaphore ()
 Destructor. More...
 

Protected Member Functions

Semaphoreoperator= (Semaphore &&)=delete
 
Semaphoreoperator= (Semaphore const &)=delete
 
 Semaphore (Semaphore &&)=delete
 
 Semaphore (Semaphore const &)=delete
 

Protected Attributes

sem_t * m_handle
 A semaphore's handle. More...
 
uint32_t m_nofHandles
 A number of the semaphore's handles. More...
 
char * m_semname
 A name of the semaphore. More...
 

Detailed Description

A semaphore class.

Definition at line 1718 of file xsens_mutex.h.

Constructor & Destructor Documentation

◆ Semaphore() [1/3]

xsens::Semaphore::Semaphore ( Semaphore const &  )
protecteddelete

◆ Semaphore() [2/3]

xsens::Semaphore::Semaphore ( Semaphore &&  )
protecteddelete

◆ Semaphore() [3/3]

xsens::Semaphore::Semaphore ( int32_t  initVal = 0,
uint32_t  nofOtherHandles = 0,
sem_t *  otherHandles = NULL 
)

Constructor.

Definition at line 803 of file threading.cpp.

◆ ~Semaphore()

xsens::Semaphore::~Semaphore ( )

Destructor.

Definition at line 834 of file threading.cpp.

Member Function Documentation

◆ operator=() [1/2]

Semaphore& xsens::Semaphore::operator= ( Semaphore &&  )
protecteddelete

◆ operator=() [2/2]

Semaphore& xsens::Semaphore::operator= ( Semaphore const &  )
protecteddelete

◆ post()

int32_t xsens::Semaphore::post ( int32_t  increment = 1)
noexcept

Increases the count of the specified semaphore object by a specified amount.

Parameters
incrementThe amount by which the semaphore object's current count is to be increased
Returns
The amount of the semaphore object's previous count

Definition at line 882 of file threading.cpp.

◆ wait1() [1/2]

bool xsens::Semaphore::wait1 ( )

Waits for an infinite time or until the semaphore is released.

Returns
True if the semaphore is released

Definition at line 841 of file threading.cpp.

◆ wait1() [2/2]

bool xsens::Semaphore::wait1 ( uint32_t  timeout)

Waits until time-out interval elapses or until the semaphore is released.

Parameters
timeoutThe timeout value to use
Returns
True if the semaphore is released

Definition at line 846 of file threading.cpp.

Member Data Documentation

◆ m_handle

sem_t* xsens::Semaphore::m_handle
protected

A semaphore's handle.

Definition at line 1725 of file xsens_mutex.h.

◆ m_nofHandles

uint32_t xsens::Semaphore::m_nofHandles
protected

A number of the semaphore's handles.

Definition at line 1727 of file xsens_mutex.h.

◆ m_semname

char* xsens::Semaphore::m_semname
protected

A name of the semaphore.

Definition at line 1724 of file xsens_mutex.h.


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


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:23