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

#include <SttclMutex.h>

List of all members.

Public Member Functions

 SttclMutex ()
 ~SttclMutex ()
void lock ()
bool try_lock (const TimeDurationType &timeout=TimeDurationType::Zero)
void unlock ()

Detailed Description

template<class Impl = STTCL_DEFAULT_MUTEXIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
class sttcl::internal::SttclMutex< Impl, TimeDurationType >

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

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

Constructor & Destructor Documentation

template<class Impl = STTCL_DEFAULT_MUTEXIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
sttcl::internal::SttclMutex< Impl, TimeDurationType >::SttclMutex ( )
inline

Constructor for class SttclMutex.

template<class Impl = STTCL_DEFAULT_MUTEXIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
sttcl::internal::SttclMutex< Impl, TimeDurationType >::~SttclMutex ( )
inline

Destructor for class SttclMutex.


Member Function Documentation

template<class Impl = STTCL_DEFAULT_MUTEXIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
void sttcl::internal::SttclMutex< Impl, TimeDurationType >::lock ( )
inline

Locks the mutex. Waits blocking forever until the mutex becomes lockable.

template<class Impl = STTCL_DEFAULT_MUTEXIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
bool sttcl::internal::SttclMutex< Impl, TimeDurationType >::try_lock ( const TimeDurationType &  timeout = TimeDurationType::Zero)
inline

Tries to lock the mutex within the specified timeout parameter. The timeout value TimeDurationType::Zero will return success or failure immediately.

Parameters:
timeoutThe maximum duration to wait until the mutex becomes lockable.
Returns:
true if the mutex is lockable. false if the timeout duration expired.
template<class Impl = STTCL_DEFAULT_MUTEXIMPL, class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>>
void sttcl::internal::SttclMutex< Impl, TimeDurationType >::unlock ( )
inline

Unlocks the mutex.


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