8#ifndef META_OCEAN_BASE_SCOPED_FUNCTION_H
9#define META_OCEAN_BASE_SCOPED_FUNCTION_H
96 function_(std::move(function))
104 *
this = std::move(scopedFunction);
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
ScopedFunctionT< T > & operator=(const ScopedFunctionT &)=delete
Disabled assign operator.
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(const ScopedFunctionT &)=delete
Disabled copy constructor.
~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.
ScopedFunctionT< std::function< void()> > ScopedFunctionVoid
Definition of a scoped function with void return parameter.
Definition ScopedFunction.h:92
The namespace covering the entire Ocean framework.
Definition Accessor.h:15