UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Function.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include <string.h>
8
9
10// Disable visualization hack for shipping builds.
11#if !ULANG_BUILD_SHIPPING && ULANG_DO_CHECK
12#define ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION 1
13#else
14#define ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION 0
15#endif
16
17#if defined(_WIN32) && !defined(_WIN64)
18 // Don't use inline storage on Win32, because that will affect the alignment of TFunction, and we can't pass extra-aligned types by value on Win32.
19 #define ULANG_FUNCTION_USES_INLINE_STORAGE 0
20#else
21 #define ULANG_FUNCTION_USES_INLINE_STORAGE 1
22 #define ULANG_FUNCTION_INLINE_SIZE 24
23 #define ULANG_FUNCTION_INLINE_ALIGNMENT 8
24#endif
25
26namespace uLang
27{
28
29template <typename FuncType> class TFunction;
30template <typename FuncType> class TFunctionRef;
31
37template <typename FuncType>
38class TFunction;
39
45template <typename FuncType>
46class TUniqueFunction;
47
53template <typename FuncType>
54class TFunctionRef;
55
59template <typename T> struct TIsTFunction { enum { Value = false }; };
60template <typename T> struct TIsTFunction<TFunction<T>> { enum { Value = true }; };
61
62template <typename T> struct TIsTFunction<const T> { enum { Value = TIsTFunction<T>::Value }; };
63template <typename T> struct TIsTFunction< volatile T> { enum { Value = TIsTFunction<T>::Value }; };
64template <typename T> struct TIsTFunction<const volatile T> { enum { Value = TIsTFunction<T>::Value }; };
65
69template <typename T> struct TIsTUniqueFunction { enum { Value = false }; };
70template <typename T> struct TIsTUniqueFunction<TUniqueFunction<T>> { enum { Value = true }; };
71
72template <typename T> struct TIsTUniqueFunction<const T> { enum { Value = TIsTUniqueFunction<T>::Value }; };
73template <typename T> struct TIsTUniqueFunction< volatile T> { enum { Value = TIsTUniqueFunction<T>::Value }; };
74template <typename T> struct TIsTUniqueFunction<const volatile T> { enum { Value = TIsTUniqueFunction<T>::Value }; };
75
79template <typename T> struct TIsTFunctionRef { enum { Value = false }; };
80template <typename T> struct TIsTFunctionRef<TFunctionRef<T>> { enum { Value = true }; };
81
82template <typename T> struct TIsTFunctionRef<const T> { enum { Value = TIsTFunctionRef<T>::Value }; };
83template <typename T> struct TIsTFunctionRef< volatile T> { enum { Value = TIsTFunctionRef<T>::Value }; };
84template <typename T> struct TIsTFunctionRef<const volatile T> { enum { Value = TIsTFunctionRef<T>::Value }; };
85
89namespace Private
90{
91 template <typename T, bool bOnHeap>
92 struct TFunction_OwnedObject;
93
94 template <bool bUnique>
95 struct TFunctionStorage;
96
101 {
105 virtual void* CloneToEmptyStorage(void* Storage) const = 0;
106
110 virtual void* GetAddress() = 0;
111
115 virtual void Destroy() = 0;
116
120 virtual ~IFunction_OwnedObject() = default;
121 };
122
126 template <typename T>
128 {
132 virtual void Destroy() override
133 {
134 void* This = this;
137 }
138
140 {
141 // It is not necessary to define this destructor but MSVC will
142 // erroneously issue warning C5046 without it.
143 }
144 };
145
149 template <typename T>
151 {
155 virtual void Destroy() override
156 {
158 }
159
161 {
162 // It is not necessary to define this destructor but MSVC will
163 // erroneously issue warning C5046 without it.
164 }
165 };
166
167 template <typename T, bool bOnHeap>
168 struct TFunction_OwnedObject : public
169#if ULANG_FUNCTION_USES_INLINE_STORAGE
170 TChooseClass<bOnHeap, IFunction_OwnedObject_OnHeap<T>, IFunction_OwnedObject_Inline<T>>::Result
171#else
173#endif
174 {
175 template <typename... ArgTypes>
176 explicit TFunction_OwnedObject(ArgTypes&&... Args)
177 : Obj(ForwardArg<ArgTypes>(Args)...)
178 {
179 }
180
181 virtual void* GetAddress() override
182 {
183 return &Obj;
184 }
185
187 };
188
192 template <typename T, bool bOnHeap>
193 struct TFunction_CopyableOwnedObject final : public TFunction_OwnedObject<T, bOnHeap>
194 {
198 explicit TFunction_CopyableOwnedObject(const T& InObj)
199 : TFunction_OwnedObject<T, bOnHeap>(InObj)
200 {
201 }
202
208 {
209 }
210
211 void* CloneToEmptyStorage(void* UntypedStorage) const override;
212 };
213
217 template <typename T, bool bOnHeap>
218 struct TFunction_UniqueOwnedObject final : public TFunction_OwnedObject<T, bOnHeap>
219 {
223 explicit TFunction_UniqueOwnedObject(T&& InObj)
225 {
226 }
227
228 void* CloneToEmptyStorage(void* Storage) const override
229 {
230 // Copy functions are deleted for TUniqueFunction
231 ULANG_ERRORF("Should never get here.");
232 return nullptr;
233 }
234 };
235
236 template <typename T>
238 TOr<
239 TIsPointer<T>,
240 TIsMemberPointer<T>,
241 TIsTFunction<T>
242 >
243 {
244 };
245
246 template <typename T>
248 {
249 // Function pointers, data member pointers, member function pointers and TFunctions
250 // can all be null/unbound, so test them using their boolean state.
251 return !!Func;
252 }
253
254 template <typename T>
256 {
257 // We can't tell if any other generic callable can be invoked, so just assume they can be.
258 return true;
259 }
260
261 template <typename FunctorType, bool bUnique, bool bOnHeap>
263
264 template <typename FunctorType, bool bOnHeap>
269
270 template <typename FunctorType, bool bOnHeap>
275
276 template <typename FunctorType, bool bUnique, bool bOnHeap>
278
280 {
282 : HeapAllocation(nullptr)
283 {
284 }
285
288 {
289 Other.HeapAllocation = nullptr;
290 #if ULANG_FUNCTION_USES_INLINE_STORAGE
291 memcpy(&InlineAllocation, &Other.InlineAllocation, sizeof(InlineAllocation));
292 #endif
293 }
294
298
300 {
301 void* NewObj = Other.GetBoundObject()->CloneToEmptyStorage(this);
302 return NewObj;
303 }
304
306 {
308 #if ULANG_FUNCTION_USES_INLINE_STORAGE
309 if (!Result)
310 {
312 }
313 #endif
314
315 return Result;
316 }
317
321 void* GetPtr() const
322 {
323 #if ULANG_FUNCTION_USES_INLINE_STORAGE
325 if (Owned)
326 {
327 return Owned->GetAddress();
328 }
329
330 return ((IFunction_OwnedObject*)&InlineAllocation)->GetAddress();
331 #else
332 return ((IFunction_OwnedObject*)HeapAllocation)->GetAddress();
333 #endif
334 }
335
339 void Unbind()
340 {
342 Owned->Destroy();
343 }
344
346 #if ULANG_FUNCTION_USES_INLINE_STORAGE
347 // Inline storage for an owned object
349 #endif
350 };
351
352 template <bool bUnique>
354 {
355 TFunctionStorage() = default;
356
361
362 template <typename FunctorType>
363 typename TDecay<FunctorType>::Type* Bind(FunctorType&& InFunc)
364 {
365 if (!IsBound(InFunc))
366 {
367 return nullptr;
368 }
369
370#if ULANG_FUNCTION_USES_INLINE_STORAGE
372#else
373 constexpr bool bUseInline = false;
374#endif
375
377
378 void* NewAlloc;
379#if ULANG_FUNCTION_USES_INLINE_STORAGE
380 if constexpr (bUseInline)
381 {
383 }
384 else
385#endif
386 {
387 NewAlloc = GetSystemParams()._HeapMalloc(sizeof(OwnedType)); // , alignof(OwnedType));
389 }
390
393 return &NewOwned->Obj;
394 }
395 };
396
397 template <typename T, bool bOnHeap>
399 {
401
402 void* NewAlloc;
403 #if ULANG_FUNCTION_USES_INLINE_STORAGE
404 if /* constexpr */ (!bOnHeap)
405 {
406 NewAlloc = &Storage.InlineAllocation;
407 }
408 else
409 #endif
410 {
411 NewAlloc = GetSystemParams()._HeapMalloc(sizeof(TFunction_CopyableOwnedObject)); // , alignof(TFunction_CopyableOwnedObject));
412 Storage.HeapAllocation = NewAlloc;
414 }
415
416 auto* NewOwned = new (NewAlloc) TFunction_CopyableOwnedObject(this->Obj);
417
418 return &NewOwned->Obj;
419 }
420
421 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
425 struct IDebugHelper
426 {
427 virtual ~IDebugHelper() = 0;
428 };
429
430 inline IDebugHelper::~IDebugHelper()
431 {
432 }
433
434 template <typename T>
436 {
437 T* Ptr = nullptr;
438 };
439 #endif
440
444 template <typename Functor, typename FuncType>
446
447 template <typename Functor, typename Ret, typename... ParamTypes>
448 struct TFunctionRefCaller<Functor, Ret (ParamTypes...)>
449 {
450 static Ret Call(void* Obj, ParamTypes&... Params)
451 {
452 return uLang::Invoke(*(Functor*)Obj, ForwardArg<ParamTypes>(Params)...);
453 }
454 };
455
456 template <typename Functor, typename... ParamTypes>
457 struct TFunctionRefCaller<Functor, void (ParamTypes...)>
458 {
459 static void Call(void* Obj, ParamTypes&... Params)
460 {
461 uLang::Invoke(*(Functor*)Obj, ForwardArg<ParamTypes>(Params)...);
462 }
463 };
464
468 template <typename StorageType, typename FuncType>
470
471 template <typename StorageType, typename Ret, typename... ParamTypes>
472 struct TFunctionRefBase<StorageType, Ret (ParamTypes...)>
473 {
474 template <typename OtherStorageType, typename OtherFuncType>
475 friend struct TFunctionRefBase;
476
478 : Callable(nullptr)
479 {
480 }
481
483 : Callable(Other.Callable)
484 , Storage (Move(Other.Storage))
485 {
486 if (Callable)
487 {
488 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
489 // Use Memcpy to copy the other DebugPtrStorage, including vptr (because we don't know the bound type
490 // here), and then reseat the underlying pointer. Possibly even more evil than the Set code.
492 memcpy(&DebugPtrStorage, &Other.DebugPtrStorage, sizeof(DebugPtrStorage)); //-V598
494 DebugPtrStorage.Ptr = Storage.GetPtr();
495 #endif
496
497 Other.Callable = nullptr;
498 }
499 }
500
501 template <typename OtherStorage>
503 : Callable(Other.Callable)
504 , Storage (Move(Other.Storage))
505 {
506 if (Callable)
507 {
508 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
509 // Use Memcpy to copy the other DebugPtrStorage, including vptr (because we don't know the bound type
510 // here), and then reseat the underlying pointer. Possibly even more evil than the Set code.
512 memcpy(&DebugPtrStorage, &Other.DebugPtrStorage, sizeof(DebugPtrStorage)); //-V598
514 DebugPtrStorage.Ptr = Storage.GetPtr();
515 #endif
516
517 Other.Callable = nullptr;
518 }
519 }
520
521 template <typename OtherStorage>
523 : Callable(Other.Callable)
524 {
525 if (Callable)
526 {
527 void* NewPtr = Storage.BindCopy(Other.Storage);
529
530 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
531 // Use Memcpy to copy the other DebugPtrStorage, including vptr (because we don't know the bound type
532 // here), and then reseat the underlying pointer. Possibly even more evil than the Set code.
534 memcpy(&DebugPtrStorage, &Other.DebugPtrStorage, sizeof(DebugPtrStorage)); //-V598
537 #endif
538 }
539 }
540
542 : Callable(Other.Callable)
543 {
544 if (Callable)
545 {
546 void* NewPtr = Storage.BindCopy(Other.Storage);
548
549 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
550 // Use Memcpy to copy the other DebugPtrStorage, including vptr (because we don't know the bound type
551 // here), and then reseat the underlying pointer. Possibly even more evil than the Set code.
553 memcpy(&DebugPtrStorage, &Other.DebugPtrStorage, sizeof(DebugPtrStorage)); //-V598
556 #endif
557 }
558 }
559
560 template <
561 typename FunctorType,
562 typename = typename TEnableIf<
563 TNot<
565 >::Value
566 >::Type
567 >
569 {
570 if (auto* Binding = Storage.Bind(ForwardArg<FunctorType>(InFunc)))
571 {
572 using DecayedFunctorType = typename TRemovePointer<decltype(Binding)>::Type;
573
574 Callable = &TFunctionRefCaller<DecayedFunctorType, Ret (ParamTypes...)>::Call;
575
576 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
577 // We placement new over the top of the same object each time. This is illegal,
578 // but it ensures that the vptr is set correctly for the bound type, and so is
579 // visualizable. We never depend on the state of this object at runtime, so it's
580 // ok.
582 DebugPtrStorage.Ptr = (void*)Binding;
583 #endif
584 }
585 }
586
589
590 // Move all of the assert code out of line
591 void CheckCallable() const
592 {
593 ULANG_ASSERTF(Callable, "Attempting to call an unbound TFunction!");
594 }
595
596 Ret operator()(ParamTypes... Params) const
597 {
598 CheckCallable();
599 return Callable(Storage.GetPtr(), Params...);
600 }
601
603 {
604 if (Callable)
605 {
606 Storage.Unbind();
607 }
608 }
609
610 protected:
611 bool IsSet() const
612 {
613 return !!Callable;
614 }
615
616 private:
617 // A pointer to a function which invokes the call operator on the callable object
618 Ret (*Callable)(void*, ParamTypes&...) = nullptr;
619
620 StorageType Storage;
621
622 #if ULANG_ENABLE_TFUNCTIONREF_VISUALIZATION
623 // To help debug visualizers
625 #endif
626 };
627
628 template <typename FunctorType, typename Ret, typename... ParamTypes>
630 : TIsConstructible<Ret, decltype(DeclVal<FunctorType>()(DeclVal<ParamTypes>()...))>
631 {
632 };
633
634 template <typename MemberRet, typename Class, typename Ret, typename... ParamTypes>
635 struct TFunctorReturnTypeIsCompatible<MemberRet Class::*, Ret, ParamTypes...>
636 : TIsConstructible<Ret, MemberRet>
637 {
638 };
639
640 template <typename MemberRet, typename Class, typename Ret, typename... ParamTypes>
641 struct TFunctorReturnTypeIsCompatible<MemberRet Class::* const, Ret, ParamTypes...>
642 : TIsConstructible<Ret, MemberRet>
643 {
644 };
645
646 template <typename MemberRet, typename Class, typename... MemberParamTypes, typename Ret, typename... ParamTypes>
647 struct TFunctorReturnTypeIsCompatible<MemberRet (Class::*)(MemberParamTypes...), Ret, ParamTypes...>
648 : TIsConstructible<Ret, MemberRet>
649 {
650 };
651
652 template <typename MemberRet, typename Class, typename... MemberParamTypes, typename Ret, typename... ParamTypes>
653 struct TFunctorReturnTypeIsCompatible<MemberRet (Class::*)(MemberParamTypes...) const, Ret, ParamTypes...>
654 : TIsConstructible<Ret, MemberRet>
655 {
656 };
657
658 template <typename FuncType, typename FunctorType>
660
661 template <typename FunctorType, typename Ret, typename... ParamTypes>
662 struct TFuncCanBindToFunctor<Ret(ParamTypes...), FunctorType> :
663 TAnd<
664 TIsInvocable<FunctorType, ParamTypes...>,
665 TFunctorReturnTypeIsCompatible<FunctorType, Ret, ParamTypes...>
666 >
667 {
668 };
669
670 template <typename FunctorType, typename... ParamTypes>
671 struct TFuncCanBindToFunctor<void(ParamTypes...), FunctorType> :
672 TIsInvocable<FunctorType, ParamTypes...>
673 {
674 };
675
677 {
678 template <typename FunctorType>
680 {
681 ULANG_ASSERTF(IsBound(InFunc), "Cannot bind a null/unbound callable to a TFunctionRef");
682
683 Ptr = (void*)&InFunc;
684 return &InFunc;
685 }
686
688 {
689 void* OtherPtr = Other.Ptr;
690 Ptr = OtherPtr;
691 return OtherPtr;
692 }
693
697 void* GetPtr() const
698 {
699 return Ptr;
700 }
701
705 void Unbind() const
706 {
707 // FunctionRefs don't own their binding - do nothing
708 }
709
710 private:
711 // A pointer to the callable object
712 void* Ptr;
713 };
714}
715
767template <typename FuncType>
768class TFunctionRef : public Private::TFunctionRefBase<Private::FFunctionRefStoragePolicy, FuncType>
769{
771
772public:
776 template <
777 typename FunctorType,
778 typename = typename TEnableIf<
779 TAnd<
782 >::Value
783 >::Type
784 >
785 TFunctionRef(FunctorType&& InFunc)
786 : Super(ForwardArg<FunctorType>(InFunc))
787 {
788 // This constructor is disabled for TFunctionRef types so it isn't incorrectly selected as copy/move constructors.
789 }
790
791 TFunctionRef(const TFunctionRef&) = default;
792
793 // We delete the assignment operators because we don't want it to be confused with being related to
794 // regular C++ reference assignment - i.e. calling the assignment operator of whatever the reference
795 // is bound to - because that's not what TFunctionRef does, nor is it even capable of doing that.
796 TFunctionRef& operator=(const TFunctionRef&) const = delete;
797 ~TFunctionRef() = default;
798};
799
837template <typename FuncType>
838class TFunction final : public Private::TFunctionRefBase<Private::TFunctionStorage<false>, FuncType>
839{
841
842public:
847 {
848 }
849
853 template <
854 typename FunctorType,
855 typename = typename TEnableIf<
856 TAnd<
859 >::Value
860 >::Type
861 >
862 TFunction(FunctorType&& InFunc)
863 : Super(ForwardArg<FunctorType>(InFunc))
864 {
865 // This constructor is disabled for TFunction types so it isn't incorrectly selected as copy/move constructors.
866
867 // This is probably a mistake if you expect TFunction to take a copy of what
868 // TFunctionRef is bound to, because that's not possible.
869 //
870 // If you really intended to bind a TFunction to a TFunctionRef, you can just
871 // wrap it in a lambda (and thus it's clear you're just binding to a call to another
872 // reference):
873 //
874 // TFunction<int32(float)> MyFunction = [MyFunctionRef](float F) { return MyFunctionRef(F); };
875 static_assert(!TIsTFunctionRef<typename TDecay<FunctorType>::Type>::Value, "Cannot construct a TFunction from a TFunctionRef");
876 }
877
878 TFunction(TFunction&&) = default;
879 TFunction(const TFunction& Other) = default;
880 ~TFunction() = default;
881
886 {
887 Swap(*this, Other);
888 return *this;
889 }
890
895 {
896 TFunction Temp = Other;
897 Swap(*this, Temp);
898 return *this;
899 }
900
904 void Reset()
905 {
906 *this = nullptr;
907 }
908
912 ULANG_FORCEINLINE explicit operator bool() const
913 {
914 return Super::IsSet();
915 }
916};
917
934template <typename FuncType>
935class TUniqueFunction final : public Private::TFunctionRefBase<Private::TFunctionStorage<true>, FuncType>
936{
938
939public:
944 {
945 }
946
950 template <
951 typename FunctorType,
952 typename = typename TEnableIf<
953 TAnd<
956 >::Value
957 >::Type
958 >
959 TUniqueFunction(FunctorType&& InFunc)
960 : Super(ForwardArg<FunctorType>(InFunc))
961 {
962 // This constructor is disabled for TUniqueFunction types so it isn't incorrectly selected as copy/move constructors.
963
964 // This is probably a mistake if you expect TFunction to take a copy of what
965 // TFunctionRef is bound to, because that's not possible.
966 //
967 // If you really intended to bind a TFunction to a TFunctionRef, you can just
968 // wrap it in a lambda (and thus it's clear you're just binding to a call to another
969 // reference):
970 //
971 // TFunction<int32(float)> MyFunction = [MyFunctionRef](float F) { return MyFunctionRef(F); };
972 static_assert(!TIsTFunctionRef<typename TDecay<FunctorType>::Type>::Value, "Cannot construct a TUniqueFunction from a TFunctionRef");
973 }
974
979 : Super(Move(*(Private::TFunctionRefBase<Private::TFunctionStorage<false>, FuncType>*)&Other))
980 {
981 }
982
987 : Super(*(const Private::TFunctionRefBase<Private::TFunctionStorage<false>, FuncType>*)&Other)
988 {
989 }
990
995 {
996 Swap(*this, Other);
997 return *this;
998 }
999
1003 ~TUniqueFunction() = default;
1004
1008 void Reset()
1009 {
1010 *this = nullptr;
1011 }
1012
1016 ULANG_FORCEINLINE explicit operator bool() const
1017 {
1018 return Super::IsSet();
1019 }
1020};
1021
1025template <typename FuncType>
1027{
1028 return !Func;
1029}
1030
1034template <typename FuncType>
1036{
1037 return !Func;
1038}
1039
1043template <typename FuncType>
1045{
1046 return (bool)Func;
1047}
1048
1052template <typename FuncType>
1054{
1055 return (bool)Func;
1056}
1057
1058} // namespace uLang
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
const bool
Definition NetworkReplayStreaming.h:178
#define ULANG_CA_ASSUME(Expr)
Definition Common.h:257
#define ULANG_IGNORE_CLASS_MEMACCESS_WARNING_START
Definition Common.h:128
#define ULANG_FORCEINLINE
Definition Common.h:188
#define ULANG_IGNORE_CLASS_MEMACCESS_WARNING_END
Definition Common.h:129
#define VERSE_SUPPRESS_UNUSED(_Variable)
Definition Common.h:298
#define ULANG_ERRORF(format,...)
Definition Common.h:289
#define ULANG_ASSERTF(expr, format,...)
Definition Common.h:290
#define ULANG_FUNCTION_INLINE_ALIGNMENT
Definition Function.h:23
#define ULANG_FUNCTION_INLINE_SIZE
Definition Function.h:22
memcpy(InputBufferBase, BinkBlocksData, BinkBlocksSize)
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition FunctionFwd.h:19
Definition Conditionals.h:116
Definition Conditionals.h:95
Definition Function.h:769
TFunctionRef(FunctorType &&InFunc)
Definition Function.h:785
~TFunctionRef()=default
TFunctionRef(const TFunctionRef &)=default
TFunctionRef & operator=(const TFunctionRef &) const =delete
Definition Function.h:839
TFunction(const TFunction &Other)=default
TFunction & operator=(TFunction &&Other)
Definition Function.h:885
void Reset()
Definition Function.h:904
TFunction(NullPtrType=nullptr)
Definition Function.h:846
~TFunction()=default
TFunction(TFunction &&)=default
TFunction & operator=(const TFunction &Other)
Definition Function.h:894
TFunction(FunctorType &&InFunc)
Definition Function.h:862
Definition Function.h:936
TUniqueFunction(NullPtrType=nullptr)
Definition Function.h:943
TUniqueFunction(const TUniqueFunction &Other)=delete
void Reset()
Definition Function.h:1008
TUniqueFunction & operator=(const TUniqueFunction &Other)=delete
TUniqueFunction & operator=(TUniqueFunction &&Other)
Definition Function.h:994
TUniqueFunction(const TFunction< FuncType > &Other)
Definition Function.h:986
TUniqueFunction(TFunction< FuncType > &&Other)
Definition Function.h:978
TUniqueFunction(TUniqueFunction &&)=default
TUniqueFunction(FunctorType &&InFunc)
Definition Function.h:959
Definition OverriddenPropertySet.cpp:45
typename TStorageOwnerType< FunctorType, bUnique, bOnHeap >::Type TStorageOwnerTypeT
Definition Function.h:277
ULANG_FORCEINLINE TEnableIf< TIsNullableBinding< T >::Value, bool >::Type IsBound(const T &Func)
Definition Function.h:247
Definition VVMEngineEnvironment.h:23
std::nullptr_t NullPtrType
Definition Common.h:325
SSystemParams & GetSystemParams()
Global variable for efficient access.
Definition Common.cpp:9
ULANG_FORCEINLINE bool operator!=(NullPtrType, const TFunction< FuncType > &Func)
Definition Function.h:1044
bool operator==(const SSystemParams &Lhs, const SSystemParams &Rhs)
Definition Common.cpp:21
ULANG_FORCEINLINE auto Invoke(FuncType &&Func, ArgTypes &&... Args) -> decltype(uLang::ForwardArg< FuncType >(Func)(uLang::ForwardArg< ArgTypes >(Args)...))
Definition Invoke.h:47
ULANG_FORCEINLINE T && ForwardArg(typename TRemoveReference< T >::Type &Obj)
Definition References.h:115
ULANG_FORCEINLINE TRemoveReference< T >::Type && Move(T &&Obj)
Definition References.h:86
@ false
Definition radaudio_common.h:23
void * GetPtr() const
Definition Function.h:697
TRemoveReference< FunctorType >::Type * Bind(FunctorType &&InFunc)
Definition Function.h:679
void Unbind() const
Definition Function.h:705
void * BindCopy(const FFunctionRefStoragePolicy &Other)
Definition Function.h:687
Definition Function.h:280
FFunctionStorage & operator=(const FFunctionStorage &Other)=delete
IFunction_OwnedObject * GetBoundObject() const
Definition Function.h:305
FFunctionStorage & operator=(FFunctionStorage &&Other)=delete
void Unbind()
Definition Function.h:339
FFunctionStorage(FFunctionStorage &&Other)
Definition Function.h:286
uint8_t InlineAllocation[ULANG_FUNCTION_INLINE_SIZE]
Definition Function.h:348
FFunctionStorage(const FFunctionStorage &Other)=delete
void * BindCopy(const FFunctionStorage &Other)
Definition Function.h:299
void * GetPtr() const
Definition Function.h:321
void * HeapAllocation
Definition Function.h:345
FFunctionStorage()
Definition Function.h:281
~IFunction_OwnedObject_Inline() override
Definition Function.h:160
virtual void Destroy() override
Definition Function.h:155
~IFunction_OwnedObject_OnHeap() override
Definition Function.h:139
virtual void Destroy() override
Definition Function.h:132
Definition Function.h:101
virtual void * CloneToEmptyStorage(void *Storage) const =0
Definition Function.h:659
TFunctionRefBase(TFunctionRefBase &&Other)
Definition Function.h:482
Ret operator()(ParamTypes... Params) const
Definition Function.h:596
TFunctionRefBase(const TFunctionRefBase &Other)
Definition Function.h:541
TFunctionRefBase(FunctorType &&InFunc)
Definition Function.h:568
TFunctionRefBase & operator=(TFunctionRefBase &&)=delete
TFunctionRefBase(TFunctionRefBase< OtherStorage, Ret(ParamTypes...)> &&Other)
Definition Function.h:502
TFunctionRefBase(const TFunctionRefBase< OtherStorage, Ret(ParamTypes...)> &Other)
Definition Function.h:522
TFunctionRefBase & operator=(const TFunctionRefBase &)=delete
Definition Function.h:469
static Ret Call(void *Obj, ParamTypes &... Params)
Definition Function.h:450
static void Call(void *Obj, ParamTypes &... Params)
Definition Function.h:459
Definition Function.h:445
Definition Function.h:354
TDecay< FunctorType >::Type * Bind(FunctorType &&InFunc)
Definition Function.h:363
TFunctionStorage(FFunctionStorage &&Other)
Definition Function.h:357
TFunction_CopyableOwnedObject(T &&InObj)
Definition Function.h:206
TFunction_CopyableOwnedObject(const T &InObj)
Definition Function.h:198
void * CloneToEmptyStorage(void *UntypedStorage) const override
Definition Function.h:398
Definition Function.h:174
TFunction_OwnedObject(ArgTypes &&... Args)
Definition Function.h:176
virtual void * GetAddress() override
Definition Function.h:181
T Obj
Definition Function.h:186
void * CloneToEmptyStorage(void *Storage) const override
Definition Function.h:228
TFunction_UniqueOwnedObject(T &&InObj)
Definition Function.h:223
Definition Function.h:243
Definition Function.h:262
FFree _HeapFree
Free system heap memory.
Definition Common.h:415
FMalloc _HeapMalloc
Allocate system heap memory.
Definition Common.h:413
Definition Conditionals.h:16
typename Private::TDecayNonReference< typename TRemoveReference< T >::Type >::Type Type
Definition References.h:60
Definition TypeTraits.h:237
Definition Invoke.h:159
Definition TypeTraits.h:298
Definition Function.h:79
@ Value
Definition Function.h:79
Definition Function.h:59
@ Value
Definition Function.h:59
Definition Function.h:69
@ Value
Definition Function.h:69
Definition Conditionals.h:75
Definition Conditionals.h:45
Definition References.h:77
T Type
Definition References.h:17