8 #ifndef META_OCEAN_BASE_SCOPED_VALUE_H
9 #define META_OCEAN_BASE_SCOPED_VALUE_H
46 inline ScopedValueT(T& target,
const T& delayedValue,
const T& immediateValue);
54 inline ScopedValueT(T& target, T&& delayedValue, T&& immediateValue);
108 template <
typename T>
111 valueDelayed(delayedValue)
116 template <
typename T>
119 valueDelayed(std::move(delayedValue))
124 template <
typename T>
127 valueDelayed(delayedValue)
129 target = immediateValue;
132 template <
typename T>
135 valueDelayed(std::move(delayedValue))
137 target = std::move(immediateValue);
140 template <
typename T>
143 valueTarget = valueDelayed;
146 template <
typename T>
149 valueDelayed = value;
152 template <
typename T>
155 valueDelayed = std::move(value);
158 template <
typename T>
164 template <
typename T>
167 valueTarget = std::move(value);
This class implements a scoped value that allows to change a specified value at the end of a scope.
Definition: ScopedValue.h:23
ScopedValueT(const ScopedValueT< T > &value)=delete
Disabled copy constructor.
ScopedValueT(T &target, const T &delayedValue)
Creates a new scoped value object.
Definition: ScopedValue.h:109
T valueDelayed
Value that will be assigned at the end of the surrounding scope.
Definition: ScopedValue.h:105
ScopedValueT & operator=(const ScopedValueT< T > &value)=delete
Disabled copy operator.
~ScopedValueT()
Destructs the scoped value object.
Definition: ScopedValue.h:141
T & valueTarget
Target value that will be changed at the end of the surrounding scope.
Definition: ScopedValue.h:102
void setImmediately(const T &value)
Immediately changes the target value, the modification is not applied at the end of the surrounding s...
Definition: ScopedValue.h:159
void setDelayed(const T &value)
Changes the value that will be assigned at the end of the surrounding scope.
Definition: ScopedValue.h:147
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15