mn::basic_clock< TLockType > Class Template Reference
#include <mn_clock.hpp>
Inheritance diagram for mn::basic_clock< TLockType >:
Collaboration diagram for mn::basic_clock< TLockType >:
Public Types | |
using | LockType_t = TLockType |
Public Types inherited from mn::ILockObject | |
using | this_type = ILockObject |
Public Member Functions | |
basic_clock (LockType_t &m, bool bLocked, unsigned int timeout) | |
basic_clock (basic_clock const &)=delete | |
~basic_clock () | |
virtual int | lock (unsigned int timeout) |
virtual int | unlock () |
bool | is_locked () |
bool | is_unlocked () |
operator bool () | |
void | operator= (basic_clock const &)=delete |
Public Member Functions inherited from mn::basic_semaphore | |
basic_semaphore () | |
basic_semaphore (const basic_semaphore &other) | |
basic_semaphore (basic_semaphore &&other) | |
virtual int | time_lock (const struct timespec *timeout) |
void * | get_handle () |
int | get_error () |
virtual bool | is_initialized () const |
virtual bool | is_locked () const |
Is locked? More... | |
bool | operator== (const basic_semaphore &r) const |
bool | operator!= (const basic_semaphore &r) const |
bool | operator< (const basic_semaphore &r) const |
bool | operator> (const basic_semaphore &r) const |
Public Member Functions inherited from mn::ILockObject | |
ILockObject () | |
virtual bool | try_lock () |
Protected Attributes | |
LockType_t & | m_refLockRefObject |
unsigned int | m_iLocks |
Protected Attributes inherited from mn::basic_semaphore | |
void * | m_pSpinlock |
int | m_iCreateErrorCode |
bool | m_isLocked |
Additional Inherited Members | |
Protected Member Functions inherited from mn::basic_semaphore | |
void | set_error (int error) |
Detailed Description
template<class TLockType>
class mn::basic_clock< TLockType >
Template wrapper for basic_semaphores for counting lock
Member Typedef Documentation
◆ LockType_t
template<class TLockType >
using mn::basic_clock< TLockType >::LockType_t = TLockType |
Constructor & Destructor Documentation
◆ basic_clock() [1/2]
template<class TLockType >
|
inline |
Constructor
- Parameters
-
m The reference to the basic_semaphore object for counting bLocked when true then lock the reference of the basic_semaphore object timeout How long to wait to get the lock until giving up.
◆ basic_clock() [2/2]
template<class TLockType >
|
delete |
We are not copyable.
◆ ~basic_clock()
template<class TLockType >
|
inline |
Destructor - unlock the reference object
Member Function Documentation
◆ is_locked()
template<class TLockType >
|
inline |
If the object locked ?
- Returns
- if true then are locked and if false when not
◆ is_unlocked()
template<class TLockType >
|
inline |
If the object unlocked ?
- Returns
- if true then are unlocked and if false when not
◆ lock()
template<class TLockType >
|
inlinevirtual |
lock (take) a semaphore.
- Parameters
-
timeout How long to wait to get the lock until giving up.
- Returns
- ERR_SPINLOCK_OK if the Semaphore was locked, ERR_SPINLOCK_LOCK if it timed out.
Reimplemented from mn::basic_semaphore.
◆ operator bool()
template<class TLockType >
|
inline |
If the object locked ?
- Returns
- if true then are locked and if false when not
◆ operator=()
template<class TLockType >
|
delete |
We are not assignable.
◆ unlock()
template<class TLockType >
|
inlinevirtual |
unlock (give) a semaphore.
- Returns
- ERR_SPINLOCK_OK if the Semaphore was unlocked, ERR_SPINLOCK_UNLOCK if it failed.
Reimplemented from mn::basic_semaphore.
Member Data Documentation
◆ m_iLocks
template<class TLockType >
|
protected |
◆ m_refLockRefObject
template<class TLockType >
|
protected |
The documentation for this class was generated from the following file: