UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CustomBoneIndexArray.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
7#include <initializer_list>
8#include <type_traits>
9
10
11namespace UE::Anim { namespace Private {
12
13// TRangeIndexType extracts RangeType::IndexType if it exists, otherwise void
14template<typename RangeType, typename = void>
16{
17 using Type = void;
18};
19
20template<typename RangeType>
21struct TRangeIndexType<RangeType, std::void_t<typename std::decay_t<RangeType>::IndexType>>
22{
23 using Type = typename std::decay_t<RangeType>::IndexType;
24};
25
26// IndexType is compatible with RangeType::IndexType if they are the same or if RangeType doesn't have an index type
27template<typename IndexType, typename RangeType>
29{
30 enum
31 {
32 Value =
33 std::is_same_v<IndexType, typename TRangeIndexType<RangeType>::Type> ||
34 std::is_void_v<typename TRangeIndexType<RangeType>::Type>
35 };
36};
37
38} // namespace UE::Anim::Private
39
40
41template<typename InIndexType, typename InRangeType>
42class TTypedIndexRange : public InRangeType
43{
44public:
45 using BaseType = InRangeType;
47 using ElementType = typename InRangeType::ElementType;
48 using SizeType = typename InRangeType::SizeType;
49
50 TTypedIndexRange() = default;
51
52 // Forwarding constructor that disallows mixing index types
53 template<typename T>
56 {
57 static_assert(Private::TIsCompatibleRangeIndexType<IndexType, T>::Value, "TTypedIndexRange can't construct from a different index type");
58 }
59
60 TTypedIndexRange(std::initializer_list<ElementType> List)
61 : BaseType(List)
62 {
63 }
64
65 // Forwarding assignment that disallows mixing index types
66 template<typename T>
68 {
69 static_assert(Private::TIsCompatibleRangeIndexType<IndexType, T>::Value, "TTypedIndexRange can't assign from a different index type");
70 BaseType::operator=(Forward<T>(Other));
71 return *this;
72 }
73
74 TTypedIndexRange& operator=(std::initializer_list<ElementType> List)
75 {
76 BaseType::operator=(List);
77 return *this;
78 }
79
81 {
82 return BaseType::operator[](Index);
83 }
85 {
86 return BaseType::operator[](Index);
87 }
89 {
90 return BaseType::operator[]((SizeType)Index);
91 }
93 {
94 return BaseType::operator[]((SizeType)Index);
95 }
96};
97
98template<typename IndexType, typename ...TArrayArgs>
100
101template<typename IndexType, typename ...TArrayViewArgs>
103
104} // namespace UE::Anim
105
108
109template<typename ElementType, typename BoneIndexType>
111
112template <typename ...ArgTypes>
113struct TIsContiguousContainer<UE::Anim::TTypedIndexRange<ArgTypes...>>
114{
115 enum { Value = true };
116};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define FORCEINLINE
Definition AndroidPlatform.h:140
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition ArrayView.h:139
Definition Array.h:670
Definition CustomBoneIndexArray.h:43
InRangeType BaseType
Definition CustomBoneIndexArray.h:45
InIndexType IndexType
Definition CustomBoneIndexArray.h:46
FORCEINLINE const ElementType & operator[](const IndexType &Index) const
Definition CustomBoneIndexArray.h:92
TTypedIndexRange(T &&Other)
Definition CustomBoneIndexArray.h:54
typename InRangeType::ElementType ElementType
Definition CustomBoneIndexArray.h:47
FORCEINLINE ElementType & operator[](const IndexType &Index)
Definition CustomBoneIndexArray.h:88
TTypedIndexRange & operator=(std::initializer_list< ElementType > List)
Definition CustomBoneIndexArray.h:74
FORCEINLINE ElementType & operator[](SizeType Index)
Definition CustomBoneIndexArray.h:80
TTypedIndexRange(std::initializer_list< ElementType > List)
Definition CustomBoneIndexArray.h:60
TTypedIndexRange & operator=(T &&Other)
Definition CustomBoneIndexArray.h:67
typename InRangeType::SizeType SizeType
Definition CustomBoneIndexArray.h:48
FORCEINLINE const ElementType & operator[](SizeType Index) const
Definition CustomBoneIndexArray.h:84
Definition OverriddenPropertySet.cpp:45
Definition AnimationAsset.h:42
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition IsContiguousContainer.h:16
static constexpr bool Value
Definition IsContiguousContainer.h:20
Definition CustomBoneIndexArray.h:29
@ Value
Definition CustomBoneIndexArray.h:32
typename std::decay_t< RangeType >::IndexType Type
Definition CustomBoneIndexArray.h:23
Definition CustomBoneIndexArray.h:16
void Type
Definition CustomBoneIndexArray.h:17