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);
111 valueDelayed(delayedValue)
119 valueDelayed(std::move(delayedValue))
127 valueDelayed(delayedValue)
129 target = immediateValue;
135 valueDelayed(std::move(delayedValue))
137 target = std::move(immediateValue);
143 valueTarget = valueDelayed;
149 valueDelayed = value;
155 valueDelayed = std::move(value);
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()
Destructs the scoped value object.
Definition ScopedValue.h:141
ScopedValueT & operator=(const ScopedValueT< T > &value)=delete
Disabled copy operator.
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