FScriptMapHelper: Pseudo dynamic map. 更多...
#include <UnrealType.h>
被 FScriptMapHelper_InContainer 继承.
Public 成员函数 | |
| int32 | AddDefaultValue_Invalid_NeedsRehash () |
| Adds a blank, constructed value to a given size. 更多... | |
| void | AddPair (const void *KeyPtr, const void *ValuePtr) |
| Adds the (key, value) pair to the map, returning true if the element was added, or false if the element was already present and has been overwritten | |
| FORCEINLINE int32 | AddUninitializedValue () |
| Add an uninitialized value to the end of the map. 更多... | |
| void | EmptyValues (int32 Slack=0) |
| Remove all values from the map, calling destructors, etc as appropriate. 更多... | |
| int32 | FindInternalIndex (int32 LogicalIdx) const |
| Maps have gaps in their indices, so this function translates a logical index (ie. 更多... | |
| int32 | FindMapIndexWithKey (const void *PairWithKeyToFind, int32 IndexHint=0) const |
| Finds the index of an element in a map which matches the key in another pair. 更多... | |
| uint8 * | FindMapPairPtrFromHash (const void *KeyPtr) |
| Finds the associated pair from hash, rather than linearly searching | |
| FORCEINLINE uint8 * | FindMapPairPtrWithKey (const void *PairWithKeyToFind, int32 IndexHint=0) |
| Finds the pair in a map which matches the key in another pair. 更多... | |
| void * | FindOrAdd (const void *KeyPtr) |
| Finds or adds a new default-constructed value 更多... | |
| uint8 * | FindValueFromHash (const void *KeyPtr) |
| Finds the associated value from hash, rather than linearly searching | |
| FORCEINLINE | FScriptMapHelper (const FMapProperty *InProperty, const void *InMap) |
| Constructor, brings together a property and an instance of the property located in memory 更多... | |
| FProperty * | GetKeyProperty () const |
| Returns the property representing the key of the map pair. 更多... | |
| FORCEINLINE uint8 * | GetKeyPtr (int32 Index) |
| Returns a uint8 pointer to the Key (first element) in the map. 更多... | |
| FORCEINLINE int32 | GetMaxIndex () const |
| Returns the (non-inclusive) maximum index of elements in the map. 更多... | |
| FORCEINLINE uint8 * | GetPairPtr (int32 Index) |
| Returns a uint8 pointer to the pair in the map 更多... | |
| FORCEINLINE const uint8 * | GetPairPtr (int32 Index) const |
| Returns a uint8 pointer to the pair in the map. 更多... | |
| FProperty * | GetValueProperty () const |
| Returns the property representing the value of the map pair. 更多... | |
| FORCEINLINE uint8 * | GetValuePtr (int32 Index) |
| Returns a uint8 pointer to the Value (second element) in the map. 更多... | |
| bool | HasKey (const void *InBaseAddress, const FString &InKeyValue) const |
| Checks if a key in the map matches the specified key 更多... | |
| FORCEINLINE bool | IsValidIndex (int32 Index) const |
| Index range check 更多... | |
| void | MoveAssign (void *InOtherMap) |
| Move the allocation from another map and make it our own. 更多... | |
| FORCEINLINE int32 | Num () const |
| Returns the number of elements in the map. 更多... | |
| COREUOBJECT_API void | Rehash () |
| Rehashes the keys in the map. 更多... | |
| void | RemoveAt (int32 Index, int32 Count=1) |
| Removes an element at the specified index, destroying it. 更多... | |
| bool | RemovePair (const void *KeyPtr) |
| Removes the key and its associated value from the map | |
静态 Public 成员函数 | |
| static FORCEINLINE int32 | Num (const void *Target) |
| Static version of Num() used when you don't need to bother to construct a FScriptMapHelper. 更多... | |
FScriptMapHelper: Pseudo dynamic map.
Used to work with map properties in a sensible way.
|
inline |
Constructor, brings together a property and an instance of the property located in memory
| InProperty | The property associated with this memory |
| InMap | Pointer to raw memory that corresponds to this map. This can be NULL, and sometimes is, but in that case almost all operations will crash. |
|
inline |
Adds a blank, constructed value to a given size.
Note that this will create an invalid map because all the keys will be default constructed, and the map needs rehashing.
|
inline |
Add an uninitialized value to the end of the map.
|
inline |
Remove all values from the map, calling destructors, etc as appropriate.
| Slack | used to presize the set for a subsequent add, to avoid reallocation. |
|
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!
|
inline |
Finds the index of an element in a map which matches the key in another pair.
| PairWithKeyToFind | The address of a map pair which contains the key to search for. |
| IndexHint | The index to start searching from. |
|
inline |
Finds the pair in a map which matches the key in another pair.
| PairWithKeyToFind | The address of a map pair which contains the key to search for. |
| IndexHint | The index to start searching from. |
|
inline |
Finds or adds a new default-constructed value
No need to rehash after calling. The hash table must be properly hashed before calling.
|
inline |
Returns the property representing the key of the map pair.
|
inline |
Returns a uint8 pointer to the Key (first element) in the map.
Currently identical to GetPairPtr, but provides clarity of purpose and avoids exposing implementation details of TMap.
| Index | index of the item to return a pointer to. |
|
inline |
Returns the (non-inclusive) maximum index of elements in the map.
|
inline |
Returns a uint8 pointer to the pair in the map
| Index | index of the item to return a pointer to. |
|
inline |
Returns a uint8 pointer to the pair in the map.
| Index | index of the item to return a pointer to. |
|
inline |
Returns the property representing the value of the map pair.
|
inline |
Returns a uint8 pointer to the Value (second element) in the map.
| Index | index of the item to return a pointer to. |
|
inline |
Checks if a key in the map matches the specified key
| InBaseAddress | The base address of the map |
| InKeyValue | The key to find within the map |
|
inline |
Index range check
| Index | Index to check |
|
inline |
Move the allocation from another map and make it our own.
| InOtherMap | The map to move the allocation from. |
|
inline |
Returns the number of elements in the map.
|
inlinestatic |
Static version of Num() used when you don't need to bother to construct a FScriptMapHelper.
Returns the number of elements in the map.
| Target | Pointer to the raw memory associated with a FScriptMap |
| COREUOBJECT_API void FScriptMapHelper::Rehash | ( | ) |
Rehashes the keys in the map.
This function must be called to create a valid map.
|
inline |
Removes an element at the specified index, destroying it.
| Index | The index of the element to remove. |