"ScL Feature"
/
ScL Feature
0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
Toggle main menu visibility
Loading...
Searching...
No Matches
wrapper_lock.h
1
#pragma once
2
3
#ifndef DOXYGEN
4
5
#include <scl/feature/detail/wrapper_lock.h>
6
#include <scl/feature/type_traits/wrapper.h>
7
8
namespace
scl
9
{
10
template
<
typename
Refer>
11
using
wrapper_lock
= ::scl::feature::detail::wrapper_lock<Refer>;
12
}
// namespace scl
13
14
#else
// DOXYGEN
15
16
namespace
scl
17
{
21
44
template
<
typename
Refer>
45
class
wrapper_lock
46
{
47
public
:
48
wrapper_lock(wrapper_lock &&) =
delete
;
49
wrapper_lock(wrapper_lock
const
&) =
delete
;
50
wrapper_lock & operator=(wrapper_lock &&) =
delete
;
51
wrapper_lock & operator=(wrapper_lock
const
&) =
delete
;
52
58
explicit
wrapper_lock
(Refer ref);
59
66
~wrapper_lock
();
67
76
void
lock
();
77
87
void
unlock
();
88
94
[[nodiscard]]
95
Refer
wrapper_value
() const noexcept;
96
105
[[nodiscard]]
106
decltype(auto)
value
() const noexcept;
107
};
108
// end of group scl_feature_locking
110
}
// namespace scl
111
112
#endif
// DOXYGEN
scl::wrapper_lock
Lazy RAII lock for a single wrapper layer.
Definition
wrapper_lock.h:46
scl::wrapper_lock::wrapper_value
Refer wrapper_value() const noexcept
Returns the wrapper reference itself without requiring the lock.
scl::wrapper_lock::~wrapper_lock
~wrapper_lock()
Releases the guard if it was acquired.
scl::wrapper_lock::value
decltype(auto) value() const noexcept
Returns the inner value through the executor.
scl::wrapper_lock::lock
void lock()
Acquires the guard on the executor (idempotent).
scl::wrapper_lock::unlock
void unlock()
Releases the guard on the executor (idempotent).
scl::wrapper_lock::wrapper_lock
wrapper_lock(Refer ref)
Constructs the lock storing ref. No guard is acquired.
scl
Root namespace of the ScL project.
src
scl
feature
wrapper_lock.h
Generated by
1.18.0