This class implements an optional recursive scoped lock object locking the lock object only if it's defined.
More...
|
Lock * | lock_ = nullptr |
| Lock object which is locked during the existence of this scoped lock object. More...
|
|
This class implements an optional recursive scoped lock object locking the lock object only if it's defined.
- See also
- Lock, ScopedLock, TemplatedScopedLock, TemporaryScopedLock.
◆ OptionalScopedLock() [1/3]
Ocean::OptionalScopedLock::OptionalScopedLock |
( |
Lock * |
lock | ) |
|
|
inlineexplicit |
Creates a new optional scoped lock object by a given lock object.
- Parameters
-
lock | Optional lock object used for locking, otherwise nullptr |
◆ OptionalScopedLock() [2/3]
Ocean::OptionalScopedLock::OptionalScopedLock |
( |
Lock & |
lock, |
|
|
const bool |
apply |
|
) |
| |
|
inline |
Creates a new optional scoped lock object by a given lock object and a boolean statement whether the lock is invoked or not.
- Parameters
-
lock | The lock object used for locking |
apply | True, to invoke the lock; False, to avoid the locking |
◆ ~OptionalScopedLock()
Ocean::OptionalScopedLock::~OptionalScopedLock |
( |
| ) |
|
|
inline |
Destructs an optional scoped lock and unlocks the internal lock object if defined.
◆ OptionalScopedLock() [3/3]
Disabled accessible copy operator.
- Parameters
-
◆ lock()
Lock * Ocean::OptionalScopedLock::lock |
( |
| ) |
const |
|
inline |
Returns the lock object which (if existing) is locked during the existence of this scoped lock object.
- Returns
- The associated lock object, nullptr if no lock object was provided when this object was created
◆ operator=()
Disabled accessible assigns operator.
- Parameters
-
- Returns
- Reference to this object
◆ lock_
Lock* Ocean::OptionalScopedLock::lock_ = nullptr |
|
protected |
Lock object which is locked during the existence of this scoped lock object.
The documentation for this class was generated from the following file: