Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/StructUtils
References
| Module | CoreUObject |
| Header | /Engine/Source/Runtime/CoreUObject/Public/StructUtils/StructTypeBitSet.h |
| Include | #include "StructUtils/StructTypeBitSet.h" |
Syntax
struct FStructTracker
Remarks
The TStructTypeBitSet holds information on "existence" of subtypes of a given UStruct. The information on available child-structs is gathered lazily - the internal FStructTracker is assigning a given type a new index the very first time the type is encountered. To create a specific instantiation of the type you also need to provide a type that will instantiate a static FStructTracker instance. The supplied macros hide this details away however.
To do declare a bitset type for an arbitrary struct type FFooBar add the following in your header or cpp file:
DECLARE_STRUCTTYPEBITSET(FMyFooBarBitSet, FFooBar);
where FMyFooBarBitSet is the alias of the type you can use in your code. To have your type exposed to other modules use DECLARE_STRUCTTYPEBITSET_EXPORTED, like so:
DECLARE_STRUCTTYPEBITSET_EXPORTED(MYMODULE_API, FMyFooBarBitSet, FFooBar);
You also need to instantiate the static FStructTracker added by the DECLARE* macro. You can easily do it by placing the following in your cpp file (continuing the FFooBar example):
DEFINE_TYPEBITSET(FMyFooBarBitSet);
Variables
| Type | Name | Description | |
|---|---|---|---|
| const FBaseStructGetter | BaseStructGetter | ||
| TArray< FName, TInlineAllocator< 64 > > | DebugStructTypeNamesList | ||
| uint32 | SerializationHash | ||
| TArray< TWeakObjectPtr< const UStruct >, TInlineAllocator< 64 > > | StructTypesList | ||
| TSet< uint32 > | StructTypeToIndexSet |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FStructTracker
(
const FBaseStructGetter& InBaseStructGetter |
The input parameter is a function that fetches the UStruct representing the base class for all the stored structs. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| TConstArrayView< TWeakObjectPtr< const T > > | |||
| FName | DebugGetStructTypeName
(
const int32 StructTypeIndex |
||
| void | |||
| int32 | FindOrAddStructTypeIndex
(
const UStruct& InStructType |
||
| const UStruct * | GetStructType
(
const int32 StructTypeIndex |
||
| int32 | Num () |
||
| void | Serialize
(
FArchive& Ar, |
Typedefs
| Name | Description |
|---|---|
| FBaseStructGetter |