![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <StructTypeBitSet.h>
Inheritance diagram for TStructTypeBitSet< TBaseStruct, TStructTrackerWrapper, TUStructType >:Public Types | |
| using | Super = TTypeBitSetBase< TStructTypeBitSet, TBaseStruct, TUStructType, FStructTypeBitSet::FBitSetContainer > |
| using | FStructTrackerWrapper = TStructTrackerWrapper |
| using | FUStructType = TUStructType |
| using | FBaseStruct = TBaseStruct |
Public Types inherited from TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime > | |
| using | FUStructType = TStructType |
| using | FBaseStruct = TBaseStruct |
| using | FContainer = TBitSetContainer |
Static Public Member Functions | |
| static int32 | GetTypeIndex (const FUStructType &InStructType) |
| template<typename T > | |
| static int32 | GetTypeIndex () |
| template<typename T > | |
| static const TStructTypeBitSet & | GetTypeBitSet () |
| static const FUStructType * | GetTypeAtIndex (const int32 Index) |
| static int32 | GetMaxNum () |
| static const UStruct * | GetBaseUStruct () |
Static Public Member Functions inherited from TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime > | |
| static const UStruct * | GetBaseUStruct () |
Public Attributes | |
| friend | Super |
| FContainer | StructTypesBitArray |
Friends | |
| uint32 | GetTypeHash (const TStructTypeBitSet &Instance) |
| FArchive & | operator<< (FArchive &Ar, TStructTypeBitSet &Instance) |
Additional Inherited Members | |
Protected Member Functions inherited from TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime > | |
| TTypeBitSetBase ()=default | |
| TTypeBitSetBase (FContainer &InContainer) | |
Protected Attributes inherited from TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime > | |
| FContainer | StructTypesBitArray |
The TStructTypeBitSet holds information on "existence" of subtypes of a given UStruct. The information on available child-structs is gathered lazily - the internal FStructTracker assigns 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 detail.
To 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);
| TBaseStruct | - The base struct type for type validation. |
| TStructTrackerWrapper | - A wrapper providing a FStructTracker instance. |
| TUStructType | - Unreal's struct type, typically UScriptStruct or UClass (defaults to UScriptStruct). |
| using TStructTypeBitSet< TBaseStruct, TStructTrackerWrapper, TUStructType >::FBaseStruct = TBaseStruct |
| using TStructTypeBitSet< TBaseStruct, TStructTrackerWrapper, TUStructType >::FStructTrackerWrapper = TStructTrackerWrapper |
| using TStructTypeBitSet< TBaseStruct, TStructTrackerWrapper, TUStructType >::FUStructType = TUStructType |
| using TStructTypeBitSet< TBaseStruct, TStructTrackerWrapper, TUStructType >::Super = TTypeBitSetBase<TStructTypeBitSet, TBaseStruct, TUStructType, FStructTypeBitSet::FBitSetContainer> |
|
default |
|
inlineexplicit |
Constructor that initializes the bitset with a single struct type.
| StructType | - The struct type to add. |
|
inlineexplicit |
Constructor that initializes the bitset with an initializer list of struct types.
| InitList | - The initializer list of struct type pointers. |
|
inlineexplicit |
Constructor that initializes the bitset with an array view of struct types.
| InitList | - The array view of struct type pointers. |
|
inlineexplicit |
This constructor is only available for UScriptStructs. Initializes the bitset with an array view of FInstancedStruct.
| InitList | - The array view of FInstancedStruct. |
|
inline |
Adds a struct type to the bitset.
| T | - The struct type to add. |
|
inline |
Adds a struct type to the bitset.
| InStructType | - The struct type to add. |
|
inline |
Checks if the bitset contains a specific struct type.
| T | - The struct type to check for. |
|
inline |
Checks if the bitset contains a specific struct type.
| InStructType | - The struct type to check for. |
|
inline |
Provides a placeholder debug string when debug info is compiled out.
|
inline |
Exports types stored in the bitset to an output array. Note: This method can be slow due to the use of weak pointers in the struct tracker.
| OutTypes | - The array to populate with struct types. |
|
inline |
Lists all types used by this bitset, calling the provided callback for each one. Returning false from the callback will early-out of iterating over the types.
Note that this function is slow due to the FStructTracker utilizing WeakObjectPtrs to store types.
| Callback | - The callback function to invoke for each type. |
|
inlinestatic |
|
inlinestatic |
Gets the maximum number of struct types registered in the tracker.
|
inline |
Retrieves the FStructTracker associated with this bitset.
|
inline |
Retrieves the FStructTracker associated with this bitset (const version).
|
inlinestatic |
Gets the struct type associated with a given index.
| Index | - The index of the struct type. |
|
inlinestatic |
Gets a bitset representing a single struct type.
| T | - The struct type to get the bitset for. |
|
inlinestatic |
Gets the index of a struct type within the tracker, adding it if not already present.
| T | - The struct type to get the index for. |
|
inlinestatic |
Gets the index of a struct type within the tracker, adding it if not already present.
| InStructType | - The struct type to get the index for. |
|
inline |
Inequality operator.
| Other | - The other bitset to compare. |
|
inline |
Adds a struct type to the bitset, returning a new bitset.
| NewElement | - The struct type to add. |
|
inline |
Performs a union operation with another bitset.
| Other | - The other bitset to combine with. |
|
inline |
Adds the bits from another bitset to this one (union).
| Other | - The other bitset to add. |
|
inline |
Removes a struct type from the bitset, returning a new bitset.
| NewElement | - The struct type to remove. |
|
inline |
Performs a difference operation with another bitset.
| Other | - The other bitset to subtract. |
|
inline |
Removes the bits from another bitset from this one (difference).
| Other | - The other bitset to subtract. |
|
inline |
Equality operator.
| Other | - The other bitset to compare |
|
inline |
Removes a struct type from the bitset.
| T | - The struct type to remove. |
|
inline |
Removes a struct type from the bitset.
| InStructType | - The struct type to remove. |
|
inline |
Removes the bits from another bitset from this one (difference).
| Other | - The other bitset to subtract. |
|
inline |
Serializes the bitset using the provided archive.
| Ar | - The archive to serialize with. |
|
friend |
Hash function for the bitset.
| Instance | - The bitset instance to hash. |
|
friend |
Stream insertion operator for serialization.
| Ar | - The archive to serialize with. |
| Instance | - The bitset instance to serialize. |
| FContainer TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::StructTypesBitArray |
The bitset container storing the bits representing struct types
| friend TStructTypeBitSet< TBaseStruct, TStructTrackerWrapper, TUStructType >::Super |