8 #ifndef META_OCEAN_BASE_SCOPED_FUNCTION_H
9 #define META_OCEAN_BASE_SCOPED_FUNCTION_H
101 template <
typename T>
104 *
this = std::move(scopedFunction);
107 template <
typename T>
113 template <
typename T>
124 template <
typename T>
130 template <
typename T>
133 if (
this != &scopedFunction)
137 function_ = std::move(scopedFunction.function_);
138 scopedFunction.function_ = T();
This class holds a function which will be invoked once the object is disposed.
Definition: ScopedFunction.h:25
void release()
Explicitly released this object.
Definition: ScopedFunction.h:114
T function_
The function to be invoked.
Definition: ScopedFunction.h:85
ScopedFunctionT & operator=(ScopedFunctionT< T > &&scopedFunction) noexcept
Move operator.
Definition: ScopedFunction.h:131
~ScopedFunctionT()
Destructs this object and invoked the function if this object holds function.
Definition: ScopedFunction.h:108
void revoke()
Revokes the function call.
Definition: ScopedFunction.h:125
ScopedFunctionT()=default
Creates an object without function.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15