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

#include <Set.h>

+ Collaboration diagram for TScriptSet< Allocator, InDerivedType >:

Public Member Functions

 TScriptSet ()
 
bool IsValidIndex (int32 Index) const
 
bool IsEmpty () const
 
int32 Num () const
 
int32 GetMaxIndex () const
 
voidGetData (int32 Index, const FScriptSetLayout &Layout)
 
const voidGetData (int32 Index, const FScriptSetLayout &Layout) const
 
void MoveAssign (DerivedType &Other, const FScriptSetLayout &Layout)
 
void Empty (int32 Slack, const FScriptSetLayout &Layout)
 
void RemoveAt (int32 Index, const FScriptSetLayout &Layout)
 
int32 AddUninitialized (const FScriptSetLayout &Layout)
 
void Rehash (const FScriptSetLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash)
 
int32 FindIndex (const void *Element, const FScriptSetLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> EqualityFn)
 
int32 FindIndexByHash (const void *Element, const FScriptSetLayout &Layout, uint32 KeyHash, TFunctionRef< bool(const void *, const void *)> EqualityFn)
 
int32 FindOrAdd (const void *Element, const FScriptSetLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> EqualityFn, TFunctionRef< void(void *)> ConstructFn)
 
void Add (const void *Element, const FScriptSetLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash, TFunctionRef< bool(const void *, const void *)> EqualityFn, TFunctionRef< void(void *)> ConstructFn, TFunctionRef< void(void *)> DestructFn)
 
 TScriptSet (const TScriptSet &)
 
void operator= (const TScriptSet &)
 

Static Public Member Functions

static FScriptSetLayout GetScriptLayout (int32 ElementSize, int32 ElementAlignment)
 

Private Types

using DerivedType = typename TChooseClass<std::is_void_v<InDerivedType>, TScriptSet, InDerivedType>::Result
 
typedef TScriptSparseArray< typename Allocator::SparseArrayAllocator > ElementArrayType
 
typedef Allocator::HashAllocator::template ForElementType< FSetElementIdHashType
 

Private Member Functions

int32 FindIndexImpl (const void *Element, const FScriptSetLayout &Layout, uint32 KeyHash, TFunctionRef< bool(const void *, const void *)> EqualityFn)
 
int32 AddNewElement (const FScriptSetLayout &Layout, TFunctionRef< uint32(const void *)> GetKeyHash, uint32 KeyHash, TFunctionRef< void(void *)> ConstructFn)
 
FORCEINLINE FSetElementIdGetTypedHash (int32 HashIndex) const
 

Static Private Member Functions

static FSetElementIdGetHashNextIdRef (const void *Element, const FScriptSetLayout &Layout)
 
static int32GetHashIndexRef (const void *Element, const FScriptSetLayout &Layout)
 
static void CheckConstraints ()
 

Private Attributes

ElementArrayType Elements
 
HashType Hash
 
int32 HashSize
 

Detailed Description

template<typename Allocator, typename InDerivedType>
class TScriptSet< Allocator, InDerivedType >

Definition at line 1813 of file Set.h.

Member Typedef Documentation

◆ DerivedType

Definition at line 1815 of file Set.h.

◆ ElementArrayType

typedef TScriptSparseArray<typename Allocator::SparseArrayAllocator> TScriptSet< Allocator, InDerivedType >::ElementArrayType
private

Definition at line 2081 of file Set.h.

◆ HashType

typedef Allocator::HashAllocator::template ForElementType<FSetElementId> TScriptSet< Allocator, InDerivedType >::HashType
private

Definition at line 2082 of file Set.h.

Constructor & Destructor Documentation

◆ TScriptSet() [1/2]

Definition at line 1835 of file Set.h.

◆ TScriptSet() [2/2]

Member Function Documentation

◆ Add()

void TScriptSet< Allocator, InDerivedType >::Add ( const void * Element,
const FScriptSetLayout & Layout,
TFunctionRef< uint32(const void *)> GetKeyHash,
TFunctionRef< bool(const void *, const void *)> EqualityFn,
TFunctionRef< void(void *)> ConstructFn,
TFunctionRef< void(void *)> DestructFn )
inline

Definition at line 2033 of file Set.h.

◆ AddNewElement()

int32 TScriptSet< Allocator, InDerivedType >::AddNewElement ( const FScriptSetLayout & Layout,
TFunctionRef< uint32(const void *)> GetKeyHash,
uint32 KeyHash,
TFunctionRef< void(void *)> ConstructFn )
inlineprivate

Definition at line 2055 of file Set.h.

◆ AddUninitialized()

int32 TScriptSet< Allocator, InDerivedType >::AddUninitialized ( const FScriptSetLayout & Layout)
inline

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

Returns
The index of the added element.

Definition at line 1929 of file Set.h.

◆ CheckConstraints()

static void TScriptSet< Allocator, InDerivedType >::CheckConstraints ( )
inlinestaticprivate

Definition at line 2104 of file Set.h.

◆ Empty()

Definition at line 1879 of file Set.h.

◆ FindIndex()

int32 TScriptSet< Allocator, InDerivedType >::FindIndex ( const void * Element,
const FScriptSetLayout & Layout,
TFunctionRef< uint32(const void *)> GetKeyHash,
TFunctionRef< bool(const void *, const void *)> EqualityFn )
inline

Definition at line 2000 of file Set.h.

◆ FindIndexByHash()

int32 TScriptSet< Allocator, InDerivedType >::FindIndexByHash ( const void * Element,
const FScriptSetLayout & Layout,
uint32 KeyHash,
TFunctionRef< bool(const void *, const void *)> EqualityFn )
inline

Definition at line 2011 of file Set.h.

◆ FindIndexImpl()

int32 TScriptSet< Allocator, InDerivedType >::FindIndexImpl ( const void * Element,
const FScriptSetLayout & Layout,
uint32 KeyHash,
TFunctionRef< bool(const void *, const void *)> EqualityFn )
inlineprivate

Definition at line 1980 of file Set.h.

◆ FindOrAdd()

int32 TScriptSet< Allocator, InDerivedType >::FindOrAdd ( const void * Element,
const FScriptSetLayout & Layout,
TFunctionRef< uint32(const void *)> GetKeyHash,
TFunctionRef< bool(const void *, const void *)> EqualityFn,
TFunctionRef< void(void *)> ConstructFn )
inline

Definition at line 2021 of file Set.h.

◆ GetData() [1/2]

void * TScriptSet< Allocator, InDerivedType >::GetData ( int32 Index,
const FScriptSetLayout & Layout )
inline

Definition at line 1860 of file Set.h.

◆ GetData() [2/2]

const void * TScriptSet< Allocator, InDerivedType >::GetData ( int32 Index,
const FScriptSetLayout & Layout ) const
inline

Definition at line 1865 of file Set.h.

◆ GetHashIndexRef()

static int32 & TScriptSet< Allocator, InDerivedType >::GetHashIndexRef ( const void * Element,
const FScriptSetLayout & Layout )
inlinestaticprivate

Definition at line 2098 of file Set.h.

◆ GetHashNextIdRef()

static FSetElementId & TScriptSet< Allocator, InDerivedType >::GetHashNextIdRef ( const void * Element,
const FScriptSetLayout & Layout )
inlinestaticprivate

Definition at line 2093 of file Set.h.

◆ GetMaxIndex()

int32 TScriptSet< Allocator, InDerivedType >::GetMaxIndex ( ) const
inline

Definition at line 1855 of file Set.h.

◆ GetScriptLayout()

static FScriptSetLayout TScriptSet< Allocator, InDerivedType >::GetScriptLayout ( int32 ElementSize,
int32 ElementAlignment )
inlinestatic

Definition at line 1818 of file Set.h.

◆ GetTypedHash()

FORCEINLINE FSetElementId & TScriptSet< Allocator, InDerivedType >::GetTypedHash ( int32 HashIndex) const
inlineprivate

Definition at line 2088 of file Set.h.

◆ IsEmpty()

bool TScriptSet< Allocator, InDerivedType >::IsEmpty ( ) const
inline

Definition at line 1845 of file Set.h.

◆ IsValidIndex()

bool TScriptSet< Allocator, InDerivedType >::IsValidIndex ( int32 Index) const
inline

Definition at line 1840 of file Set.h.

◆ MoveAssign()

void TScriptSet< Allocator, InDerivedType >::MoveAssign ( DerivedType & Other,
const FScriptSetLayout & Layout )
inline

Definition at line 1870 of file Set.h.

◆ Num()

Definition at line 1850 of file Set.h.

◆ operator=()

◆ Rehash()

Definition at line 1935 of file Set.h.

◆ RemoveAt()

void TScriptSet< Allocator, InDerivedType >::RemoveAt ( int32 Index,
const FScriptSetLayout & Layout )
inline

Definition at line 1903 of file Set.h.

Member Data Documentation

◆ Elements

Definition at line 2084 of file Set.h.

◆ Hash

Definition at line 2085 of file Set.h.

◆ HashSize

int32 TScriptSet< Allocator, InDerivedType >::HashSize
mutableprivate

Definition at line 2086 of file Set.h.


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