engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
FScriptSetHelper类 参考

FScriptSetHelper: Pseudo dynamic Set. 更多...

#include <UnrealType.h>

被 FScriptSetHelper_InContainer 继承.

Public 成员函数

int32 AddDefaultValue_Invalid_NeedsRehash ()
 Adds a blank, constructed value to a given size. 更多...
 
void AddElement (const void *ElementToAdd)
 Adds the element to the set, returning true if the element was added, or false if the element was already present
 
FORCEINLINE int32 AddUninitializedValue ()
 Add an uninitialized value to the end of the set. 更多...
 
void EmptyElements (int32 Slack=0)
 Remove all values from the set, calling destructors, etc as appropriate. 更多...
 
int32 FindElementIndex (const void *ElementToFind, int32 IndexHint=0) const
 Finds the index of an element in a set 更多...
 
FORCEINLINE int32 FindElementIndexFromHash (const void *ElementToFind) const
 Finds element index from hash, rather than linearly searching
 
FORCEINLINE uint8 * FindElementPtr (const void *ElementToFind, int32 IndexHint=0)
 Finds the pair in a map which matches the key in another pair. 更多...
 
FORCEINLINE uint8 * FindElementPtrFromHash (const void *ElementToFind)
 Finds element pointer from hash, rather than linearly searching
 
int32 FindInternalIndex (int32 LogicalIdx) const
 Maps have gaps in their indices, so this function translates a logical index (ie. 更多...
 
FORCEINLINE FScriptSetHelper (const FSetProperty *InProperty, const void *InSet)
 Constructor, brings together a property and an instance of the property located in memory 更多...
 
FProperty * GetElementProperty () const
 Returns the property representing the element of the set
 
FORCEINLINE uint8 * GetElementPtr (int32 Index)
 Returns a uint8 pointer to the element in the set. 更多...
 
FORCEINLINE const uint8 * GetElementPtr (int32 Index) const
 Returns a uint8 pointer to the element in the set. 更多...
 
FORCEINLINE int32 GetMaxIndex () const
 Returns the (non-inclusive) maximum index of elements in the set. 更多...
 
bool HasElement (void *InBaseAddress, const FString &InElementValue) const
 Checks if an element has already been added to the set 更多...
 
FORCEINLINE bool IsValidIndex (int32 Index) const
 Index range check 更多...
 
void MoveAssign (void *InOtherSet)
 Move the allocation from another set and make it our own. 更多...
 
FORCEINLINE int32 Num () const
 Returns the number of elements in the set. 更多...
 
COREUOBJECT_API void Rehash ()
 Rehashes the keys in the set. 更多...
 
void RemoveAt (int32 Index, int32 Count=1)
 Removes an element at the specified index, destroying it. 更多...
 
bool RemoveElement (const void *ElementToRemove)
 Removes the element from the set
 

静态 Public 成员函数

static FORCEINLINE int32 Num (const void *Target)
 Static version of Num() used when you don't need to bother to construct a FScriptSetHelper. 更多...
 

详细描述

FScriptSetHelper: Pseudo dynamic Set.

Used to work with Set properties in a sensible way.

构造及析构函数说明

◆ FScriptSetHelper()

FORCEINLINE FScriptSetHelper::FScriptSetHelper ( const FSetProperty *  InProperty,
const void *  InSet 
)
inline

Constructor, brings together a property and an instance of the property located in memory

参数
InPropertyThe property associated with this memory
InSetPointer to raw memory that corresponds to this Set. This can be NULL, and sometimes is, but in that case almost all operations will crash.

成员函数说明

◆ AddDefaultValue_Invalid_NeedsRehash()

int32 FScriptSetHelper::AddDefaultValue_Invalid_NeedsRehash ( )
inline

Adds a blank, constructed value to a given size.

Note that this will create an invalid Set because all the keys will be default constructed, and the set needs rehashing.

返回
The index of the first element added.

◆ AddUninitializedValue()

FORCEINLINE int32 FScriptSetHelper::AddUninitializedValue ( )
inline

Add an uninitialized value to the end of the set.

返回
The index of the added element.

◆ EmptyElements()

void FScriptSetHelper::EmptyElements ( int32  Slack = 0)
inline

Remove all values from the set, calling destructors, etc as appropriate.

参数
Slackused to presize the set for a subsequent add, to avoid reallocation.

◆ FindElementIndex()

int32 FScriptSetHelper::FindElementIndex ( const void *  ElementToFind,
int32  IndexHint = 0 
) const
inline

Finds the index of an element in a set

参数
ElementToFindThe address of an element to search for.
IndexHintThe index to start searching from.
返回
The index of an element found in SetHelper, or -1 if none was found.

◆ FindElementPtr()

FORCEINLINE uint8 * FScriptSetHelper::FindElementPtr ( const void *  ElementToFind,
int32  IndexHint = 0 
)
inline

Finds the pair in a map which matches the key in another pair.

参数
PairWithKeyToFindThe address of a map pair which contains the key to search for.
IndexHintThe index to start searching from.
返回
A pointer to the found pair, or nullptr if none was found.

◆ FindInternalIndex()

int32 FScriptSetHelper::FindInternalIndex ( int32  LogicalIdx) const
inline

Maps have gaps in their indices, so this function translates a logical index (ie.

Nth element) to an internal index that can be used for the other functions in this class. NOTE: This is slow, do not use this for iteration!

◆ GetElementPtr() [1/2]

FORCEINLINE uint8 * FScriptSetHelper::GetElementPtr ( int32  Index)
inline

Returns a uint8 pointer to the element in the set.

参数
Indexindex of the item to return a pointer to.
返回
Pointer to the element, or nullptr if the set is empty.

◆ GetElementPtr() [2/2]

FORCEINLINE const uint8 * FScriptSetHelper::GetElementPtr ( int32  Index) const
inline

Returns a uint8 pointer to the element in the set.

参数
Indexindex of the item to return a pointer to.
返回
Pointer to the element, or nullptr if the set is empty.

◆ GetMaxIndex()

FORCEINLINE int32 FScriptSetHelper::GetMaxIndex ( ) const
inline

Returns the (non-inclusive) maximum index of elements in the set.

返回
The (non-inclusive) maximum index of elements in the set.

◆ HasElement()

bool FScriptSetHelper::HasElement ( void *  InBaseAddress,
const FString &  InElementValue 
) const
inline

Checks if an element has already been added to the set

参数
InBaseAddressThe base address of the set
InElementValueThe element value to check for
返回
True if the element is found in the set, false otherwise

◆ IsValidIndex()

FORCEINLINE bool FScriptSetHelper::IsValidIndex ( int32  Index) const
inline

Index range check

参数
IndexIndex to check
返回
true if accessing this element is legal.

◆ MoveAssign()

void FScriptSetHelper::MoveAssign ( void *  InOtherSet)
inline

Move the allocation from another set and make it our own.

注解
The sets MUST be of the same type, and this function will NOT validate that!
参数
InOtherSetThe set to move the allocation from.

◆ Num() [1/2]

FORCEINLINE int32 FScriptSetHelper::Num ( ) const
inline

Returns the number of elements in the set.

返回
The number of elements in the set.

◆ Num() [2/2]

static FORCEINLINE int32 FScriptSetHelper::Num ( const void *  Target)
inlinestatic

Static version of Num() used when you don't need to bother to construct a FScriptSetHelper.

Returns the number of elements in the set.

参数
TargetPointer to the raw memory associated with a FScriptSet
返回
The number of elements in the set.

◆ Rehash()

COREUOBJECT_API void FScriptSetHelper::Rehash ( )

Rehashes the keys in the set.

This function must be called to create a valid set.

◆ RemoveAt()

void FScriptSetHelper::RemoveAt ( int32  Index,
int32  Count = 1 
)
inline

Removes an element at the specified index, destroying it.

参数
IndexThe index of the element to remove.

该类的文档由以下文件生成: