ISIX-RTOS - small operating system for ARM microcontrollers 1.2
Public Member Functions | Private Member Functions | Private Attributes | Friends

isix::semaphore Class Reference

Semaphore C++ class wrapper. More...

#include <semaphore.h>

Collaboration diagram for isix::semaphore:
Collaboration graph
[legend]

Public Member Functions

 semaphore (int val, int limit_val=ISIX_SEM_ULIMITED)
 ~semaphore ()
 Destruct semaphore object.
bool is_valid ()
int wait (tick_t timeout)
int get_isr ()
int signal ()
int signal_isr ()
int setval (int val)
int getval ()

Private Member Functions

 semaphore (const semaphore &)
semaphoreoperator= (const semaphore &)

Private Attributes

sem_tsem

Friends

union ihandle

Detailed Description

Semaphore C++ class wrapper.

Definition at line 153 of file isix/semaphore.h.


Constructor & Destructor Documentation

isix::semaphore::semaphore ( int  val,
int  limit_val = ISIX_SEM_ULIMITED 
) [inline, explicit]

Construct semaphore object

Parameters:
[in]valInitial value of the semaphore

Definition at line 162 of file isix/semaphore.h.

References isix::isix_sem_create_limited(), NULL, and sem.

isix::semaphore::~semaphore ( ) [inline]

Destruct semaphore object.

Definition at line 167 of file isix/semaphore.h.

References isix::isix_sem_destroy(), and sem.

isix::semaphore::semaphore ( const semaphore ) [private]

Member Function Documentation

int isix::semaphore::get_isr ( ) [inline]

Get the semaphore from the ISR context

Returns:
ISIX_EOK if the operation is completed successfully otherwise return an error code

Definition at line 185 of file isix/semaphore.h.

References isix::isix_sem_get_isr(), and sem.

int isix::semaphore::getval ( ) [inline]

Get the semaphore value

Returns:
the semaphore value otherwise an error

Definition at line 214 of file isix/semaphore.h.

References isix::isix_sem_getval(), and sem.

bool isix::semaphore::is_valid ( ) [inline]

Check the fifo object is in valid state

Returns:
true if object is in valid state otherwise return false

Definition at line 174 of file isix/semaphore.h.

References sem.

semaphore& isix::semaphore::operator= ( const semaphore ) [private]
int isix::semaphore::setval ( int  val) [inline]

Set value of the semaphore

Parameters:
[in]valValue of the semaphore
Returns:
ISIX_EOK if the operation is completed successfully otherwise return an error code

Definition at line 207 of file isix/semaphore.h.

References isix::isix_sem_setval(), and sem.

int isix::semaphore::signal ( ) [inline]

Signaling the semaphore

Returns:
ISIX_EOK if the operation is completed successfully otherwise return an error code

Definition at line 192 of file isix/semaphore.h.

References isix::isix_sem_signal(), and sem.

int isix::semaphore::signal_isr ( ) [inline]

Signal the semaphore from the ISR context

Returns:
ISIX_EOK if the operation is completed successfully otherwise return an error code

Definition at line 199 of file isix/semaphore.h.

References isix::isix_sem_signal_isr(), and sem.

int isix::semaphore::wait ( tick_t  timeout) [inline]

Wait for the semaphore for selected time

Parameters:
[in]timeoutMax waiting time

Definition at line 178 of file isix/semaphore.h.

References isix::isix_sem_wait(), and sem.


Friends And Related Function Documentation

friend union ihandle [friend]

Definition at line 156 of file isix/semaphore.h.


Field Documentation


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines