Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TScriptMap< AllocatorType, InDerivedType > Class Template Reference

#include <Map.h>

+ Collaboration diagram for TScriptMap< AllocatorType, InDerivedType >:

Public Member Functions

 TScriptMap ()
 
bool IsValidIndex (int32 Index) const
 
bool IsEmpty () const
 
int32 Num () 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 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)
 
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 FScriptMapLayout GetScriptLayout (int32 KeySize, int32 KeyAlignment, int32 ValueSize, int32 ValueAlignment)
 

Private Types

using DerivedType = typename TChooseClass<std::is_void_v<InDerivedType>, TScriptMap, InDerivedType>::Result
 

Static Private Member Functions

static void CheckConstraints ()
 

Private Attributes

TScriptSet< AllocatorType > Pairs
 

Detailed Description

template<typename AllocatorType, typename InDerivedType>
class TScriptMap< AllocatorType, InDerivedType >

Definition at line 1637 of file Map.h.

Member Typedef Documentation

◆ DerivedType

template<typename AllocatorType , typename InDerivedType >
using TScriptMap< AllocatorType, InDerivedType >::DerivedType = typename TChooseClass<std::is_void_v<InDerivedType>, TScriptMap, InDerivedType>::Result
private

Definition at line 1639 of file Map.h.

Constructor & Destructor Documentation

◆ TScriptMap() [1/2]

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

Definition at line 1657 of file Map.h.

◆ TScriptMap() [2/2]

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

Definition at line 1843 of file Map.h.

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

Definition at line 1762 of file Map.h.

◆ 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.

Definition at line 1716 of file Map.h.

◆ CheckConstraints()

template<typename AllocatorType , typename InDerivedType >
static void TScriptMap< AllocatorType, InDerivedType >::CheckConstraints ( )
inlinestaticprivate

Definition at line 1824 of file Map.h.

◆ Empty()

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

Definition at line 1700 of file Map.h.

◆ 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

Definition at line 1799 of file Map.h.

◆ 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 )
inline

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

Definition at line 1727 of file Map.h.

◆ 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

Definition at line 1749 of file Map.h.

◆ GetData() [1/2]

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

Definition at line 1681 of file Map.h.

◆ GetData() [2/2]

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

Definition at line 1686 of file Map.h.

◆ GetMaxIndex()

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

Definition at line 1676 of file Map.h.

◆ GetScriptLayout()

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

Definition at line 1642 of file Map.h.

◆ IsEmpty()

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

Definition at line 1666 of file Map.h.

◆ IsValidIndex()

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

Definition at line 1661 of file Map.h.

◆ MoveAssign()

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

Definition at line 1691 of file Map.h.

◆ Num()

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

Definition at line 1671 of file Map.h.

◆ operator=()

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

Definition at line 1844 of file Map.h.

◆ Rehash()

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

Definition at line 1721 of file Map.h.

◆ RemoveAt()

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

Definition at line 1705 of file Map.h.

Member Data Documentation

◆ Pairs

template<typename AllocatorType , typename InDerivedType >
TScriptSet<AllocatorType> TScriptMap< AllocatorType, InDerivedType >::Pairs
private

Definition at line 1821 of file Map.h.


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