sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sttcl::internal::SttclSemaphore< Impl, TimeDurationType > Class Template Reference

#include <SttclSemaphore.h>

List of all members.

Public Member Functions

 SttclSemaphore (unsigned int initialCount=0)
 ~SttclSemaphore ()
void wait ()
bool try_wait (const TimeDurationType &timeout=TimeDurationType::Zero)
void post ()

Detailed Description

template<class Impl = STTCL_DEFAULT_SEMAPHOREIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
class sttcl::internal::SttclSemaphore< Impl, TimeDurationType >

Adapter class for a (OS-)specific semaphore implementation.

Template Parameters:
ImplSelects a (OS-)specific semaphore implementation.
Todo:
Implement a static interface check for the Impl class.

Constructor & Destructor Documentation

template<class Impl = STTCL_DEFAULT_SEMAPHOREIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
sttcl::internal::SttclSemaphore< Impl, TimeDurationType >::SttclSemaphore ( unsigned int  initialCount = 0)
inline

Constructor for class SttclSemaphore.

Parameters:
initialCountSets the initial semaphore count.
template<class Impl = STTCL_DEFAULT_SEMAPHOREIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
sttcl::internal::SttclSemaphore< Impl, TimeDurationType >::~SttclSemaphore ( )
inline

Destructor for class SttclSemaphore.


Member Function Documentation

template<class Impl = STTCL_DEFAULT_SEMAPHOREIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
void sttcl::internal::SttclSemaphore< Impl, TimeDurationType >::post ( )
inline

Increments the semaphore.

template<class Impl = STTCL_DEFAULT_SEMAPHOREIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
bool sttcl::internal::SttclSemaphore< Impl, TimeDurationType >::try_wait ( const TimeDurationType &  timeout = TimeDurationType::Zero)
inline

Waits until the semaphore is incremented within the specified timeout duration. A timeout value of TimeDurationType::Zero returns the semaphore state immediatly.

Parameters:
timeoutSpecifies the maximum duration to wait until the semaphore is incremented.
Returns:
true if the semaphore was successfully decremented.
template<class Impl = STTCL_DEFAULT_SEMAPHOREIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
void sttcl::internal::SttclSemaphore< Impl, TimeDurationType >::wait ( )
inline

Waits blocking forever until the semaphore is incremented.


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