UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TScriptMap< AllocatorType, InDerivedType > Class Template Reference

#include <Map.h>

Public Types

using IntrusiveUnsetOptionalStateType = TScriptMap
 

Public Member Functions

 TScriptMap ()
 
 TScriptMap (FIntrusiveUnsetOptionalState Tag)
 
bool operator== (FIntrusiveUnsetOptionalState Tag) const
 
bool IsValidIndex (int32 Index) const
 
bool IsEmpty () const
 
int32 Num () const
 
int32 Max () const
 
int32 NumUnchecked () const
 
int32 GetMaxIndex () const
 
voidGetData (int32 Index, const FScriptMapLayout &Layout)
 
const voidGetData (int32 Index, const FScriptMapLayout &Layout) const
 
void MoveAssign (DerivedType &Other, const FScriptMapLayout &Layout)
 
void Empty (int32 Slack, const FScriptMapLayout &Layout)
 
void RemoveAt (int32 Index, const FScriptMapLayout &Layout)
 
int32 AddUninitialized (const FScriptMapLayout &Layout)
 
void RemoveAtUninitialized (const FScriptMapLayout &Layout, int32 Index)
 
void CommitLastUninitialized (const FScriptMapLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash)
 
void CommitAllUninitialized (const FScriptMapLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash)
 
void Rehash (const FScriptMapLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash)
 
int32 FindPairIndex (const void *Key, const FScriptMapLayout &MapLayout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> KeyEqualityFn) const
 
uint8FindValue (const void *Key, const FScriptMapLayout &MapLayout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> KeyEqualityFn)
 
void Add (const void *Key, const void *Value, const FScriptMapLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> KeyEqualityFn, TFunctionRef< void(void *)> KeyConstructAndAssignFn, TFunctionRef< void(void *)> ValueConstructAndAssignFn, TFunctionRef< void(void *)> ValueAssignFn, TFunctionRef< void(void *)> DestructKeyFn, TFunctionRef< void(void *)> DestructValueFn)
 
voidFindOrAdd (const void *Key, const FScriptMapLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> KeyEqualityFn, TFunctionRef< void(void *, void *)> ConstructPairFn)
 
 TScriptMap (const TScriptMap &)
 
void operator= (const TScriptMap &)
 

Static Public Member Functions

static constexpr FScriptMapLayout GetScriptLayout (int32 KeySize, int32 KeyAlignment, int32 ValueSize, int32 ValueAlignment)
 

Static Public Attributes

static constexpr bool bHasIntrusiveUnsetOptionalState = true
 

Member Typedef Documentation

◆ IntrusiveUnsetOptionalStateType

template<typename AllocatorType , typename InDerivedType >
using TScriptMap< AllocatorType, InDerivedType >::IntrusiveUnsetOptionalStateType = TScriptMap

Constructor & Destructor Documentation

◆ TScriptMap() [1/3]

template<typename AllocatorType , typename InDerivedType >
TScriptMap< AllocatorType, InDerivedType >::TScriptMap ( )
inline

◆ TScriptMap() [2/3]

template<typename AllocatorType , typename InDerivedType >
TScriptMap< AllocatorType, InDerivedType >::TScriptMap ( FIntrusiveUnsetOptionalState  Tag)
inlineexplicit

◆ TScriptMap() [3/3]

template<typename AllocatorType , typename InDerivedType >
TScriptMap< AllocatorType, InDerivedType >::TScriptMap ( const TScriptMap< AllocatorType, InDerivedType > &  )
inline

Member Function Documentation

◆ Add()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::Add ( const void Key,
const void Value,
const FScriptMapLayout Layout,
TFunctionRef< uint32(const void *)>  GetKeyHash,
TFunctionRef< bool(const void *, const void *)>  KeyEqualityFn,
TFunctionRef< void(void *)>  KeyConstructAndAssignFn,
TFunctionRef< void(void *)>  ValueConstructAndAssignFn,
TFunctionRef< void(void *)>  ValueAssignFn,
TFunctionRef< void(void *)>  DestructKeyFn,
TFunctionRef< void(void *)>  DestructValueFn 
)
inline

Adds the (key, value) pair to the map

◆ AddUninitialized()

template<typename AllocatorType , typename InDerivedType >
int32 TScriptMap< AllocatorType, InDerivedType >::AddUninitialized ( const FScriptMapLayout Layout)
inline

Adds an uninitialized object to the map. The map will need rehashing at some point after this call to make it valid.

Returns
The index of the added element.

◆ CommitAllUninitialized()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::CommitAllUninitialized ( const FScriptMapLayout Layout,
TFunctionRef< uint32(const void *)>  GetKeyHash 
)
inline

◆ CommitLastUninitialized()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::CommitLastUninitialized ( const FScriptMapLayout Layout,
TFunctionRef< uint32(const void *)>  GetKeyHash 
)
inline

◆ Empty()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::Empty ( int32  Slack,
const FScriptMapLayout Layout 
)
inline

◆ FindOrAdd()

template<typename AllocatorType , typename InDerivedType >
void * TScriptMap< AllocatorType, InDerivedType >::FindOrAdd ( const void Key,
const FScriptMapLayout Layout,
TFunctionRef< uint32(const void *)>  GetKeyHash,
TFunctionRef< bool(const void *, const void *)>  KeyEqualityFn,
TFunctionRef< void(void *, void *)>  ConstructPairFn 
)
inline

Constructs a new key-value pair if key didn't exist

No need to rehash after calling. The hash table must be properly hashed before calling.

Returns
The address to the value, not the pair

◆ FindPairIndex()

template<typename AllocatorType , typename InDerivedType >
int32 TScriptMap< AllocatorType, InDerivedType >::FindPairIndex ( const void Key,
const FScriptMapLayout MapLayout,
TFunctionRef< uint32(const void *)>  GetKeyHash,
TFunctionRef< bool(const void *, const void *)>  KeyEqualityFn 
) const
inline

Finds the associated key, value from hash of Key, rather than linearly searching

◆ FindValue()

template<typename AllocatorType , typename InDerivedType >
uint8 * TScriptMap< AllocatorType, InDerivedType >::FindValue ( const void Key,
const FScriptMapLayout MapLayout,
TFunctionRef< uint32(const void *)>  GetKeyHash,
TFunctionRef< bool(const void *, const void *)>  KeyEqualityFn 
)
inline

Finds the associated value from hash of Key, rather than linearly searching

◆ GetData() [1/2]

template<typename AllocatorType , typename InDerivedType >
void * TScriptMap< AllocatorType, InDerivedType >::GetData ( int32  Index,
const FScriptMapLayout Layout 
)
inline

◆ GetData() [2/2]

template<typename AllocatorType , typename InDerivedType >
const void * TScriptMap< AllocatorType, InDerivedType >::GetData ( int32  Index,
const FScriptMapLayout Layout 
) const
inline

◆ GetMaxIndex()

template<typename AllocatorType , typename InDerivedType >
int32 TScriptMap< AllocatorType, InDerivedType >::GetMaxIndex ( ) const
inline
Returns
The max valid index of the elements in the sparse storage.

◆ GetScriptLayout()

template<typename AllocatorType , typename InDerivedType >
static constexpr FScriptMapLayout TScriptMap< AllocatorType, InDerivedType >::GetScriptLayout ( int32  KeySize,
int32  KeyAlignment,
int32  ValueSize,
int32  ValueAlignment 
)
inlinestaticconstexpr

◆ IsEmpty()

template<typename AllocatorType , typename InDerivedType >
bool TScriptMap< AllocatorType, InDerivedType >::IsEmpty ( ) const
inline

◆ IsValidIndex()

template<typename AllocatorType , typename InDerivedType >
bool TScriptMap< AllocatorType, InDerivedType >::IsValidIndex ( int32  Index) const
inline

◆ Max()

template<typename AllocatorType , typename InDerivedType >
int32 TScriptMap< AllocatorType, InDerivedType >::Max ( ) const
inline
Returns
The number of elements the map can hold before reallocation.

◆ MoveAssign()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::MoveAssign ( DerivedType &  Other,
const FScriptMapLayout Layout 
)
inline

◆ Num()

template<typename AllocatorType , typename InDerivedType >
int32 TScriptMap< AllocatorType, InDerivedType >::Num ( ) const
inline

◆ NumUnchecked()

template<typename AllocatorType , typename InDerivedType >
int32 TScriptMap< AllocatorType, InDerivedType >::NumUnchecked ( ) const
inline

◆ operator=()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::operator= ( const TScriptMap< AllocatorType, InDerivedType > &  )
inline

◆ operator==()

template<typename AllocatorType , typename InDerivedType >
bool TScriptMap< AllocatorType, InDerivedType >::operator== ( FIntrusiveUnsetOptionalState  Tag) const
inline

◆ Rehash()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::Rehash ( const FScriptMapLayout Layout,
TFunctionRef< uint32(const void *)>  GetKeyHash 
)
inline

◆ RemoveAt()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::RemoveAt ( int32  Index,
const FScriptMapLayout Layout 
)
inline

◆ RemoveAtUninitialized()

template<typename AllocatorType , typename InDerivedType >
void TScriptMap< AllocatorType, InDerivedType >::RemoveAtUninitialized ( const FScriptMapLayout Layout,
int32  Index 
)
inline

Member Data Documentation

◆ bHasIntrusiveUnsetOptionalState

template<typename AllocatorType , typename InDerivedType >
constexpr bool TScriptMap< AllocatorType, InDerivedType >::bHasIntrusiveUnsetOptionalState = true
staticconstexpr

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