Manages locking and unlocking of a mutes. More...
#include <ScopedSemaphore.h>
Public Member Functions | |
bool | isDecremented () const |
Check if the semaphore has been successfully decremented. | |
operator bool () const | |
Implicit conversion to bool. | |
ScopedSemaphore (Semaphore &semaphore) | |
Decrements the semaphore. | |
~ScopedSemaphore () | |
Increments the semaphore. | |
Private Attributes | |
bool | m_is_decremented |
Semaphore & | m_semaphore |
Manages locking and unlocking of a mutes.
Locks or tries to lock a mutex in the constructor and unlocks it in the destructor.
Definition at line 50 of file ScopedSemaphore.h.
icl_core::logging::ScopedSemaphore::ScopedSemaphore | ( | Semaphore & | semaphore | ) | [explicit] |
Decrements the semaphore.
Definition at line 30 of file ScopedSemaphore.cpp.
Increments the semaphore.
Definition at line 40 of file ScopedSemaphore.cpp.
bool icl_core::logging::ScopedSemaphore::isDecremented | ( | ) | const [inline] |
Check if the semaphore has been successfully decremented.
Definition at line 60 of file ScopedSemaphore.h.
icl_core::logging::ScopedSemaphore::operator bool | ( | ) | const [inline] |
Implicit conversion to bool.
Definition at line 63 of file ScopedSemaphore.h.
bool icl_core::logging::ScopedSemaphore::m_is_decremented [private] |
Definition at line 78 of file ScopedSemaphore.h.
Definition at line 77 of file ScopedSemaphore.h.