UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TArrayAttribute< AttributeType > Class Template Reference

#include <AttributeArrayContainer.h>

Public Member Functions

 TArrayAttribute (ArrayType &InArray, int32 InIndex)
 
template<typename T = AttributeType, typename TEnableIf< std::is_same_v< T, const T >, int >::Type = 0>
 TArrayAttribute (TArrayAttribute< std::remove_cv_t< T > > InValue)
 
AttributeType * GetData () const
 
bool IsValidIndex (int32 ArrayAttributeIndex) const
 
bool IsEmpty () const
 
int32 Num () const
 
AttributeType & operator[] (int32 ArrayAttributeIndex) const
 
AttributeType & Last (int32 IndexFromTheEnd=0) const
 
void SetNum (int32 Num)
 
void SetNumUninitialized (int32 Num)
 
void Reserve (int32 Num)
 
int32 Add (const AttributeType &Value)
 
int32 AddUnique (const AttributeType &Value)
 
void InsertDefaulted (int32 StartIndex, int32 Count)
 
void Insert (const AttributeType &Value, int32 StartIndex)
 
void RemoveAt (int32 StartIndex, int32 Count)
 
template<typename Predicate >
int32 RemoveAll (Predicate Pred)
 
int32 Remove (const AttributeType &Value)
 
int32 Find (const AttributeType &Value) const
 
template<typename Predicate >
AttributeType * FindByPredicate (Predicate Pred) const
 
template<typename Predicate >
int32 IndexOfByPredicate (Predicate Pred) const
 
bool Contains (const AttributeType &Value) const
 
template<typename Predicate >
bool ContainsByPredicate (Predicate Pred) const
 
void Sort ()
 
template<typename Predicate >
void SortByPredicate (Predicate Pred)
 
void StableSort ()
 
template<typename Predicate >
void StableSortByPredicate (Predicate Pred)
 
TArrayView< AttributeType > ToArrayView ()
 
 operator TArrayView< AttributeType > ()
 
AttributeType * begin () const
 
AttributeType * end () const
 

Friends

template<typename T >
class TArrayAttribute
 

Detailed Description

template<typename AttributeType>
class TArrayAttribute< AttributeType >

Proxy object which fields access to an unbounded array attribute container.

Constructor & Destructor Documentation

◆ TArrayAttribute() [1/2]

template<typename AttributeType >
TArrayAttribute< AttributeType >::TArrayAttribute ( ArrayType &  InArray,
int32  InIndex 
)
inlineexplicit

◆ TArrayAttribute() [2/2]

template<typename AttributeType >
template<typename T = AttributeType, typename TEnableIf< std::is_same_v< T, const T >, int >::Type = 0>
TArrayAttribute< AttributeType >::TArrayAttribute ( TArrayAttribute< std::remove_cv_t< T > >  InValue)
inline

Construct a TArrayAttribute<const T> from a TArrayAttribute<T>.

Member Function Documentation

◆ Add()

template<typename AttributeType >
int32 TArrayAttribute< AttributeType >::Add ( const AttributeType &  Value)
inline

Adds the given value to the end of the array attribute, reserving extra space if necessary.

◆ AddUnique()

template<typename AttributeType >
int32 TArrayAttribute< AttributeType >::AddUnique ( const AttributeType &  Value)
inline

Adds the given value to the end of the array attribute, reserving extra space if necessary.

◆ begin()

template<typename AttributeType >
AttributeType * TArrayAttribute< AttributeType >::begin ( ) const
inline

DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.

◆ Contains()

template<typename AttributeType >
bool TArrayAttribute< AttributeType >::Contains ( const AttributeType &  Value) const
inline

Determines whether the array attribute contains a particular value

◆ ContainsByPredicate()

template<typename AttributeType >
template<typename Predicate >
bool TArrayAttribute< AttributeType >::ContainsByPredicate ( Predicate  Pred) const
inline

Checks if this array contains element for which the predicate is true.

Parameters
Predicateto use
Returns
True if found. False otherwise.

◆ end()

template<typename AttributeType >
AttributeType * TArrayAttribute< AttributeType >::end ( ) const
inline

◆ Find()

template<typename AttributeType >
int32 TArrayAttribute< AttributeType >::Find ( const AttributeType &  Value) const
inline

Finds the given value in the array attribute and returns its index

◆ FindByPredicate()

template<typename AttributeType >
template<typename Predicate >
AttributeType * TArrayAttribute< AttributeType >::FindByPredicate ( Predicate  Pred) const
inline

Finds an element which matches a predicate functor.

Parameters
PredThe functor to apply to each element.
Returns
Pointer to the first element for which the predicate returns true, or nullptr if none is found.

◆ GetData()

template<typename AttributeType >
AttributeType * TArrayAttribute< AttributeType >::GetData ( ) const
inline

Helper function for returning a typed pointer to the first array attribute entry.

◆ IndexOfByPredicate()

template<typename AttributeType >
template<typename Predicate >
int32 TArrayAttribute< AttributeType >::IndexOfByPredicate ( Predicate  Pred) const
inline

Finds an item by predicate.

Parameters
PredThe predicate to match.
Returns
Index to the first matching element, or INDEX_NONE if none is found.

◆ Insert()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::Insert ( const AttributeType &  Value,
int32  StartIndex 
)
inline

Inserts an element into the given index in the array attribute

◆ InsertDefaulted()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::InsertDefaulted ( int32  StartIndex,
int32  Count 
)
inline

Inserts a number of default-constructed elements in the array attribute

◆ IsEmpty()

template<typename AttributeType >
bool TArrayAttribute< AttributeType >::IsEmpty ( ) const
inline

Returns true if the array attribute is empty and contains no elements.

Returns
True if the array attribute is empty.

◆ IsValidIndex()

template<typename AttributeType >
bool TArrayAttribute< AttributeType >::IsValidIndex ( int32  ArrayAttributeIndex) const
inline

Tests if index is valid, i.e. than or equal to zero, and less than the number of elements in the array attribute.

Parameters
IndexIndex to test.
Returns
True if index is valid. False otherwise.

◆ Last()

template<typename AttributeType >
AttributeType & TArrayAttribute< AttributeType >::Last ( int32  IndexFromTheEnd = 0) const
inline

Returns n-th last element from the array attribute.

Parameters
IndexFromTheEnd(Optional) Index from the end of array. Default is 0.
Returns
Reference to n-th last element from the array.

◆ Num()

template<typename AttributeType >
int32 TArrayAttribute< AttributeType >::Num ( ) const
inline

Returns number of elements in the array attribute.

Returns
Number of elements in array attribute.

◆ operator TArrayView< AttributeType >()

template<typename AttributeType >
TArrayAttribute< AttributeType >::operator TArrayView< AttributeType > ( )
inline

Implicitly coerce an array attribute to a TArrayView.

◆ operator[]()

template<typename AttributeType >
AttributeType & TArrayAttribute< AttributeType >::operator[] ( int32  ArrayAttributeIndex) const
inline

Array bracket operator. Returns reference to array attribute element at given index.

Returns
Reference to indexed element.

◆ Remove()

template<typename AttributeType >
int32 TArrayAttribute< AttributeType >::Remove ( const AttributeType &  Value)
inline

◆ RemoveAll()

template<typename AttributeType >
template<typename Predicate >
int32 TArrayAttribute< AttributeType >::RemoveAll ( Predicate  Pred)
inline

Removes all elements which match the predicate

◆ RemoveAt()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::RemoveAt ( int32  StartIndex,
int32  Count 
)
inline

Removes a number of elements from the array attribute

◆ Reserve()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::Reserve ( int32  Num)
inline

Reserves the number of elements in the array attribute.

◆ SetNum()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::SetNum ( int32  Num)
inline

Sets the number of elements in the array attribute.

◆ SetNumUninitialized()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::SetNumUninitialized ( int32  Num)
inline

Sets the number of elements in the array attribute without initializing any new elements. It is the responsibility of the caller to do so after this function returns.

◆ Sort()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::Sort ( )
inline

Sorts the array assuming < operator is defined for the item type.

◆ SortByPredicate()

template<typename AttributeType >
template<typename Predicate >
void TArrayAttribute< AttributeType >::SortByPredicate ( Predicate  Pred)
inline

Sorts the array using the given predicate.

◆ StableSort()

template<typename AttributeType >
void TArrayAttribute< AttributeType >::StableSort ( )
inline

Stable sorts the array assuming < operator is defined for the item type.

◆ StableSortByPredicate()

template<typename AttributeType >
template<typename Predicate >
void TArrayAttribute< AttributeType >::StableSortByPredicate ( Predicate  Pred)
inline

Sorts the array using the given predicate.

◆ ToArrayView()

template<typename AttributeType >
TArrayView< AttributeType > TArrayAttribute< AttributeType >::ToArrayView ( )
inline

Return a TArrayView representing this array attribute.

Friends And Related Symbol Documentation

◆ TArrayAttribute

template<typename AttributeType >
template<typename T >
friend class TArrayAttribute
friend

The documentation for this class was generated from the following file: