Ark Server API (ASA) - Wiki
|
#include <Function.h>
Public Member Functions | |
TUniqueFunction (TYPE_OF_NULLPTR=nullptr) | |
template<typename FunctorType , typename = typename TEnableIf< TAnd< TNot<TOr<TIsTUniqueFunction<typename TDecay<FunctorType>::Type>, TIsTFunction<typename TDecay<FunctorType>::Type>>>, UE::Core::Private::Function::TFuncCanBindToFunctor<FuncType, FunctorType> >::Value >::Type> | |
TUniqueFunction (FunctorType &&InFunc) | |
TUniqueFunction (TFunction< FuncType > &&Other) | |
TUniqueFunction (const TFunction< FuncType > &Other) | |
TUniqueFunction & | operator= (TUniqueFunction &&Other) |
TUniqueFunction (TUniqueFunction &&)=default | |
TUniqueFunction (const TUniqueFunction &Other)=delete | |
TUniqueFunction & | operator= (const TUniqueFunction &Other)=delete |
~TUniqueFunction ()=default | |
void | Reset () |
FORCEINLINE | operator bool () const |
Private Types | |
using | Super = UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<true>, FuncType> |
TUniqueFunction<FuncType>
See the class definition for intended usage.
TUniqueFunction<FuncType>
Used like TFunction above, but is move-only. This allows non-copyable functors to be bound to it.
Example:
TUniquePtr<FThing> Thing = MakeUnique<FThing>();
TFunction <void()> CopyableFunc = [Thing = MoveTemp(Thing)](){ Thing->DoSomething(); }; // error - lambda is not copyable TUniqueFunction<void()> MovableFunc = [Thing = MoveTemp(Thing)](){ Thing->DoSomething(); }; // ok
void Foo(TUniqueFunction<void()> Func); Foo(MovableFunc); // error - TUniqueFunction is not copyable Foo(MoveTemp(MovableFunc)); // ok
Definition at line 952 of file Function.h.
|
private |
Definition at line 954 of file Function.h.
|
inline |
Default constructor.
Definition at line 960 of file Function.h.
|
inline |
Constructor which binds a TFunction to any function object.
Definition at line 976 of file Function.h.
|
inline |
Constructor which takes ownership of a TFunction's functor.
Definition at line 995 of file Function.h.
|
inline |
Constructor which takes ownership of a TFunction's functor.
Definition at line 1003 of file Function.h.
|
default |
|
delete |
|
default |
|
inlineexplicit |
Tests if the TUniqueFunction is callable.
Definition at line 1033 of file Function.h.
|
delete |
|
inline |
Copy/move assignment operator.
Definition at line 1011 of file Function.h.
|
inline |
Removes any bound callable from the TFunction, restoring it to the default 'empty' state.
Definition at line 1025 of file Function.h.