Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Invoke.h File Reference
#include "PointerIsConvertibleFromTo.h"
#include "UnrealTemplate.h"
#include "Decay.h"
+ Include dependency graph for Invoke.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  UE4Invoke_Private
 

Functions

template<typename BaseType , typename CallableType >
FORCEINLINE auto UE4Invoke_Private::DereferenceIfNecessary (CallableType &&Callable) -> typename TEnableIf< TPointerIsConvertibleFromTo< typename TDecay< CallableType >::Type, typename TDecay< BaseType >::Type >::Value, decltype((CallableType &&) Callable)>::Type
 
template<typename FuncType , typename... ArgTypes>
FORCEINLINE auto Invoke (FuncType &&Func, ArgTypes &&... Args) -> decltype(Forward< FuncType >(Func)(Forward< ArgTypes >(Args)...))
 
template<typename ReturnType , typename ObjType , typename CallableType >
FORCEINLINE auto Invoke (ReturnType ObjType::*pdm, CallableType &&Callable) -> decltype(UE4Invoke_Private::DereferenceIfNecessary< ObjType >(Forward< CallableType >(Callable)).*pdm)
 
template<typename ReturnType , typename ObjType , typename... PMFArgTypes, typename CallableType , typename... ArgTypes>
FORCEINLINE auto Invoke (ReturnType(ObjType::*PtrMemFun)(PMFArgTypes...), CallableType &&Callable, ArgTypes &&... Args) -> decltype((UE4Invoke_Private::DereferenceIfNecessary< ObjType >(Forward< CallableType >(Callable)).*PtrMemFun)(Forward< ArgTypes >(Args)...))
 

Function Documentation

◆ Invoke() [1/3]

template<typename FuncType , typename... ArgTypes>
FORCEINLINE auto Invoke ( FuncType && Func,
ArgTypes &&... Args ) -> decltype(Forward<FuncType>(Func)(Forward<ArgTypes>(Args)...))

Invokes a callable with a set of arguments. Allows the following:

  • Calling a functor object given a set of arguments.
  • Calling a function pointer given a set of arguments.
  • Calling a member function given a reference to an object and a set of arguments.
  • Calling a member function given a pointer (including smart pointers) to an object and a set of arguments.
  • Projecting via a data member pointer given a reference to an object.
  • Projecting via a data member pointer given a pointer (including smart pointers) to an object.

See: http://en.cppreference.com/w/cpp/utility/functional/invoke

Definition at line 41 of file Invoke.h.

◆ Invoke() [2/3]

template<typename ReturnType , typename ObjType , typename CallableType >
FORCEINLINE auto Invoke ( ReturnType ObjType::* pdm,
CallableType && Callable ) -> decltype(UE4Invoke_Private::DereferenceIfNecessary<ObjType>(Forward<CallableType>(Callable)).*pdm)

Definition at line 48 of file Invoke.h.

◆ Invoke() [3/3]

template<typename ReturnType , typename ObjType , typename... PMFArgTypes, typename CallableType , typename... ArgTypes>
FORCEINLINE auto Invoke ( ReturnType(ObjType::*)(PMFArgTypes...) PtrMemFun,
CallableType && Callable,
ArgTypes &&... Args ) -> decltype((UE4Invoke_Private::DereferenceIfNecessary<ObjType>(Forward<CallableType>(Callable)).*PtrMemFun)(Forward<ArgTypes>(Args)...))

Definition at line 55 of file Invoke.h.