Ark Server API (ASA) - Wiki
|
#include "CoreTypes.h"
#include "Templates/UnrealTemplate.h"
#include "Templates/Decay.h"
#include "Delegates/IntegerSequence.h"
#include "Templates/Invoke.h"
#include "Serialization/StructuredArchive.h"
#include "Serialization/MemoryLayout.h"
#include "Templates/TypeHash.h"
#include "Templates/IsConstructible.h"
#include <tuple>
Go to the source code of this file.
Namespaces | |
namespace | UE |
namespace | UE::Core |
namespace | UE::Core::Private |
namespace | UE::Core::Private::Tuple |
namespace | Freeze |
Macros | |
#define | UE_TUPLE_STATIC_ANALYSIS_WORKAROUND 0 |
#define | UE_TUPLE_STRUCTURED_BINDING_SUPPORT 0 |
Typedefs | |
template<typename Type , typename TupleType > | |
using | TTupleIndex = UE::Core::Private::Tuple::TCVTupleIndex<Type, const volatile TupleType> |
template<uint32 Index, typename TupleType > | |
using | TTupleElement = UE::Core::Private::Tuple::TCVTupleElement<Index, const volatile TupleType> |
Functions | |
template<typename... Types> | |
TTuple< std::decay_t< Types >... > | MakeTuple (Types &&... Args) |
template<typename... ArgTypes> | |
void | UE::Core::Private::Tuple::ConceptCheckingHelper (ArgTypes &&...) |
template<typename LhsType , typename RhsType , uint32... Indices, decltype(ConceptCheckingHelper((DeclVal< LhsType & >().template Get< Indices >()=DeclVal< RhsType && >().template Get< Indices >(), 0)...)) * = nullptr> | |
static void | UE::Core::Private::Tuple::Assign (LhsType &Lhs, RhsType &&Rhs, TIntegerSequence< uint32, Indices... >) |
template<typename... ElementTypes, typename... Types> | |
FORCEINLINE TTuple< ElementTypes... > | UE::Core::Private::Tuple::MakeTupleImpl (Types &&... Args) |
template<typename... Given, typename... Deduced> | |
std::enable_if_t< std::conjunction_v< std::is_constructible< Given, Deduced && >... > > | UE::Core::Private::Tuple::ConstructibleConceptCheck (Deduced &&...) |
template<typename... Given, typename... Deduced> | |
decltype(ConceptCheckingHelper((DeclVal< Given >()=DeclVal< Deduced && >(), 0)...)) | UE::Core::Private::Tuple::AssignableConceptCheck (Deduced &&...) |
template<typename... Types> | |
FORCEINLINE uint32 | GetTypeHash (const TTuple< Types... > &Tuple) |
FORCEINLINE uint32 | GetTypeHash (const TTuple<> &Tuple) |
template<typename KeyType , typename ValueType > | |
void | Freeze::IntrinsicWriteMemoryImage (FMemoryImageWriter &Writer, const TTuple< KeyType, ValueType > &Object, const FTypeLayoutDesc &) |
template<typename KeyType , typename ValueType > | |
uint32 | Freeze::IntrinsicUnfrozenCopy (const FMemoryUnfreezeContent &Context, const TTuple< KeyType, ValueType > &Object, void *OutDst) |
template<typename KeyType , typename ValueType > | |
uint32 | Freeze::IntrinsicAppendHash (const TTuple< KeyType, ValueType > *DummyObject, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher) |
template<typename KeyType , typename ValueType > | |
uint32 | Freeze::IntrinsicGetTargetAlignment (const TTuple< KeyType, ValueType > *DummyObject, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams) |
DECLARE_TEMPLATE_INTRINSIC_TYPE_LAYOUT ((template< typename KeyType, typename ValueType >),(TTuple< KeyType, ValueType >)) | |
template<typename... Types> | |
FORCEINLINE TTuple< std::decay_t< Types >... > | MakeTuple (Types &&... Args) |
template<typename... Types> | |
FORCEINLINE TTuple< Types &&... > | ForwardAsTuple (Types &&... Args) |
template<typename FuncType , typename... Types> | |
FORCEINLINE decltype(auto) | TransformTuple (TTuple< Types... > &&Tuple, FuncType Func) |
template<typename FuncType , typename... Types> | |
FORCEINLINE decltype(auto) | TransformTuple (const TTuple< Types... > &Tuple, FuncType Func) |
template<typename FuncType , typename FirstTupleType , typename... TupleTypes> | |
FORCEINLINE void | VisitTupleElements (FuncType &&Func, FirstTupleType &&FirstTuple, TupleTypes &&... Tuples) |
template<typename... Types> | |
FORCEINLINE TTuple< Types &... > | Tie (Types &... Args) |
template<typename... Types> | |
FORCEINLINE FArchive & | operator<< (FArchive &Ar, TTuple< Types... > &Tuple) |
template<typename... Types> | |
FORCEINLINE void | operator<< (FStructuredArchive::FSlot Slot, TTuple< Types... > &Tuple) |
Variables | |
template<typename T , typename... Types> | |
constexpr uint32 | UE::Core::Private::Tuple::TTypeCountInParameterPack_V = 0 |
template<typename T , typename U , typename... Types> | |
constexpr uint32 | UE::Core::Private::Tuple::TTypeCountInParameterPack_V< T, U, Types... > = TTypeCountInParameterPack_V<T, Types...> + (std::is_same_v<T, U> ? 1 : 0) |
template<typename T > | |
constexpr bool | TIsTuple_V = false |
template<typename... Types> | |
constexpr bool | TIsTuple_V< TTuple< Types... > > = true |
template<typename... Types> | |
constexpr bool | TIsTuple_V< const TTuple< Types... > > = true |
template<typename... Types> | |
constexpr bool | TIsTuple_V< volatile TTuple< Types... > > = true |
template<typename... Types> | |
constexpr bool | TIsTuple_V< const volatile TTuple< Types... > > = true |
Traits class which gets the element type of a TTuple with the given index. If the index is out of range, a compile error is generated.
Given Index = 1, and Tuple = TTuple<int, float, char>, TTupleElement<Index, Tuple>::Type will be float.
Traits class which gets the tuple index of a given type from a given TTuple. If the type doesn't appear, or appears more than once, a compile error is generated.
Given Type = char, and Tuple = TTuple<int, float, char>, TTupleIndex<Type, Tuple>::Value will be 2.
DECLARE_TEMPLATE_INTRINSIC_TYPE_LAYOUT | ( | (template< typename KeyType, typename ValueType >) | , |
(TTuple< KeyType, ValueType >) | ) |
FORCEINLINE TTuple< Types &&... > ForwardAsTuple | ( | Types &&... | Args | ) |
Makes a TTuple from some arguments. Unlike MakeTuple, the TTuple element types are references and retain the same value category of the arguments, like the Forward function.
Args | The arguments used to construct the tuple. |
Example:
template <typename... Ts> void Foo(const TTuple<Ts...>&);
void Func(const int32 A, FString&& B) { // Calls Foo<const int32&, const TCHAR(&)[6], FString&&>(...); Foo(ForwardAsTuple(A, TEXT("Hello"), MoveTemp(B))); }
FORCEINLINE uint32 GetTypeHash | ( | const TTuple< Types... > & | Tuple | ) |
Makes a TTuple from some arguments. The type of the TTuple elements are the decayed versions of the arguments.
Args | The arguments used to construct the tuple. |
Example:
void Func(const int32 A, FString&& B) { // Equivalent to: // TTuple<int32, const TCHAR*, FString> MyTuple(A, TEXT("Hello"), MoveTemp(B)); auto MyTuple = MakeTuple(A, TEXT("Hello"), MoveTemp(B)); }
FORCEINLINE TTuple< std::decay_t< Types >... > MakeTuple | ( | Types &&... | Args | ) |
Makes a TTuple from some arguments. The type of the TTuple elements are the decayed versions of the arguments.
Args | The arguments used to construct the tuple. |
Example:
void Func(const int32 A, FString&& B) { // Equivalent to: // TTuple<int32, const TCHAR*, FString> MyTuple(A, TEXT("Hello"), MoveTemp(B)); auto MyTuple = MakeTuple(A, TEXT("Hello"), MoveTemp(B)); }
FORCEINLINE FArchive & operator<< | ( | FArchive & | Ar, |
TTuple< Types... > & | Tuple ) |
FORCEINLINE void operator<< | ( | FStructuredArchive::FSlot | Slot, |
TTuple< Types... > & | Tuple ) |
FORCEINLINE TTuple< Types &... > Tie | ( | Types &... | Args | ) |
Tie function for structured unpacking of tuples into individual variables.
Example:
TTuple<FString, float, TArray<int32>> SomeFunction();
FString Ret1; float Ret2; TArray<int32> Ret3;
Tie(Ret1, Ret2, Ret3) = SomeFunction();
// Now Ret1, Ret2 and Ret3 contain the unpacked return values.
FORCEINLINE decltype(auto) TransformTuple | ( | TTuple< Types... > && | Tuple, |
FuncType | Func ) |
Creates a new TTuple by applying a functor to each of the elements.
Tuple | The tuple to apply the functor to. |
Func | The functor to apply. |
Example:
float Overloaded(int32 Arg); char Overloaded(const TCHAR* Arg); const TCHAR* Overloaded(const FString& Arg);
void Func(const TTuple<int32, const TCHAR*, FString>& MyTuple) { // Equivalent to: // TTuple<float, char, const TCHAR*> TransformedTuple(Overloaded(MyTuple.Get<0>()), Overloaded(MyTuple.Get<1>()), Overloaded(MyTuple.Get<2>()))); auto TransformedTuple = TransformTuple(MyTuple, [](const auto& Arg) { return Overloaded(Arg); }); }
FORCEINLINE void VisitTupleElements | ( | FuncType && | Func, |
FirstTupleType && | FirstTuple, | ||
TupleTypes &&... | Tuples ) |
Visits each element in the specified tuples in parallel and applies them as arguments to the functor. All specified tuples must have the same number of elements.
Func | The functor to apply. |
Tuples | The tuples whose elements are to be applied to the functor. |
Example:
void Func(const TTuple<int32, const TCHAR*, FString>& Tuple1, const TTuple<bool, float, FName>& Tuple2) { // Equivalent to: // Functor(Tuple1.Get<0>(), Tuple2.Get<0>()); // Functor(Tuple1.Get<1>(), Tuple2.Get<1>()); // Functor(Tuple1.Get<2>(), Tuple2.Get<2>()); VisitTupleElements(Functor, Tuple1, Tuple2); }
|
constexpr |