"ScL Feature"
/
ScL Feature
0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
Toggle main menu visibility
Loading...
Searching...
No Matches
value_lock.h
1
#pragma once
2
3
#ifndef DOXYGEN
4
5
#include <scl/feature/detail/value_lock.h>
6
#include <scl/feature/type_traits/wrapper.h>
7
8
namespace
scl
9
{
10
template
<
typename
Refer>
11
using
value_lock
= ::scl::feature::detail::value_lock<Refer>;
12
}
// namespace scl
13
14
#else
// DOXYGEN
15
16
namespace
scl
17
{
21
43
template
<
typename
Refer>
44
class
value_lock
45
{
46
public
:
47
value_lock(value_lock &&) =
delete
;
48
value_lock(value_lock
const
&) =
delete
;
49
value_lock & operator=(value_lock &&) =
delete
;
50
value_lock & operator=(value_lock
const
&) =
delete
;
51
58
explicit
value_lock
(Refer ref);
59
66
~value_lock
();
67
81
template
<
typename
Target>
82
void
lock_for
()
83
requires
::
scl
::
feature
::concepts::convertible_from<Target, Refer>;
84
98
template
<
typename
Target>
99
[[nodiscard]]
100
Target
value_as
()
101
requires
::
scl
::
feature
::concepts::convertible_from<Target, Refer>;
102
};
103
// end of group scl_feature_locking
105
}
// namespace scl
106
107
#endif
// DOXYGEN
scl::value_lock
Recursive lazy RAII lock through a wrapper chain.
Definition
value_lock.h:45
scl::value_lock::value_lock
value_lock(Refer ref)
Constructs the lock, capturing references to every executor in the wrapper chain. No guard is acquire...
scl::value_lock::value_as
Target value_as()
Returns the stored value at the level matching Target.
scl::value_lock::~value_lock
~value_lock()
Releases all guards acquired via lock_for().
scl::value_lock::lock_for
void lock_for()
Activates guards for every wrapper layer needed to reach Target.
scl::feature
Namespace of the ScL Feature module.
scl
Root namespace of the ScL project.
src
scl
feature
value_lock.h
Generated by
1.18.0