ORIGINAL
Loading...
Searching...
No Matches
original::uniqueLock Class Referencefinal

RAII wrapper for single mutex locking. More...

#include <mutex.h>

Inheritance diagram for original::uniqueLock:
Inheritance graph
Collaboration diagram for original::uniqueLock:
Collaboration graph

Public Member Functions

 uniqueLock (pMutex &p_mutex, lockPolicy policy=AUTO_LOCK)
 Constructs a uniqueLock with specified policy.
 
 uniqueLock (uniqueLock &&)=delete
 Deleted move constructor.
 
uniqueLockoperator= (uniqueLock &&)=delete
 Deleted move assignment operator.
 
bool isLocked () const noexcept override
 Checks if the lock is currently held.
 
void lock () override
 Locks the associated mutex.
 
bool tryLock () override
 Attempts to lock the associated mutex without blocking.
 
void unlock () override
 Unlocks the associated mutex.
 
 ~uniqueLock () override
 Destructor - automatically unlocks if locked.
 
- Public Member Functions inherited from original::lockGuard
 lockGuard ()=default
 Default constructor.
 
 lockGuard (const lockGuard &)=delete
 Deleted copy constructor.
 
lockGuardoperator= (const lockGuard &)=delete
 Deleted copy assignment operator.
 
virtual ~lockGuard ()=default
 Virtual destructor.
 

Additional Inherited Members

- Public Types inherited from original::lockGuard
enum class  lockPolicy { MANUAL_LOCK , AUTO_LOCK , TRY_LOCK , ADOPT_LOCK }
 Locking policies for guard construction. More...
 
- Static Public Attributes inherited from original::lockGuard
static constexpr auto MANUAL_LOCK = lockPolicy::MANUAL_LOCK
 Constant for manual lock policy.
 
static constexpr auto AUTO_LOCK = lockPolicy::AUTO_LOCK
 Constant for automatic lock policy.
 
static constexpr auto TRY_LOCK = lockPolicy::TRY_LOCK
 Constant for try-lock policy.
 
static constexpr auto ADOPT_LOCK = lockPolicy::ADOPT_LOCK
 Constant for adopt lock policy.
 
- Protected Member Functions inherited from original::lockGuard

Detailed Description

RAII wrapper for single mutex locking.

Provides scoped lock management for a single pMutex with various locking policies.

Constructor & Destructor Documentation

◆ uniqueLock()

original::uniqueLock::uniqueLock ( pMutex & p_mutex,
lockPolicy policy = AUTO_LOCK )
inlineexplicit

Constructs a uniqueLock with specified policy.

Parameters
p_mutexMutex to manage
policyLocking policy (default: AUTO_LOCK)
Exceptions
sysErrorif locking fails

Member Function Documentation

◆ isLocked()

bool original::uniqueLock::isLocked ( ) const
inlinenodiscardoverridevirtualnoexcept

Checks if the lock is currently held.

Returns
true if locked, false otherwise

Implements original::lockGuard.

◆ lock()

void original::uniqueLock::lock ( )
inlineoverridevirtual

Locks the associated mutex.

Exceptions
sysErrorif already locked or locking fails

Implements original::lockGuard.

◆ tryLock()

bool original::uniqueLock::tryLock ( )
inlineoverridevirtual

Attempts to lock the associated mutex without blocking.

Returns
true if lock was acquired, false otherwise
Exceptions
sysErrorif already locked or operation fails

Implements original::lockGuard.

◆ unlock()

void original::uniqueLock::unlock ( )
inlineoverridevirtual

Unlocks the associated mutex.

Exceptions
sysErrorif not locked or unlock fails

Implements original::lockGuard.


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