UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime > Struct Template Reference

#include <StructTypeBitSet.h>

+ Inheritance diagram for TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >:

Classes

struct  FIndexIterator
 

Public Types

using FUStructType = TStructType
 
using FBaseStruct = TBaseStruct
 
using FContainer = TBitSetContainer
 

Public Member Functions

FIndexIterator GetIndexIterator (const bool bValueToCheck=true) const
 
TImplementationGetImplementation ()
 
const TImplementationGetImplementation () const
 
void SetAll (const bool bValue=true)
 
void Add (const FUStructType &InStructType)
 
void AddAtIndex (const int32 StructTypeIndex)
 
void Remove (const FUStructType &InStructType)
 
void RemoveAtIndex (const int32 StructTypeIndex)
 
void Reset ()
 
bool Contains (const FUStructType &InStructType) const
 
UE_FORCEINLINE_HINT TImplementation operator& (const TImplementation &Other) const
 
UE_FORCEINLINE_HINT TImplementation operator| (const TImplementation &Other) const
 
UE_FORCEINLINE_HINT TImplementation GetOverlap (const TImplementation &Other) const
 
UE_FORCEINLINE_HINT bool IsEquivalent (const TImplementation &Other) const
 
UE_FORCEINLINE_HINT bool HasAll (const TImplementation &Other) const
 
UE_FORCEINLINE_HINT bool HasAny (const TImplementation &Other) const
 
UE_FORCEINLINE_HINT bool HasNone (const TImplementation &Other) const
 
bool IsEmpty () const
 
UE_FORCEINLINE_HINT bool IsBitSet (const int32 BitIndex) const
 
UE_FORCEINLINE_HINT void operator+= (const TImplementation &Other)
 
UE_FORCEINLINE_HINT void operator-= (const TImplementation &Other)
 
TImplementation operator+ (const FUStructType &NewElement) const
 
TImplementation operator- (const FUStructType &NewElement) const
 
int32 CountStoredTypes () const
 
template<typename TOutStructType , typename Allocator >
void ExportTypes (TArray< const TOutStructType *, Allocator > &OutTypes) const
 
SIZE_T GetAllocatedSize () const
 

Static Public Member Functions

static const UStructGetBaseUStruct ()
 

Protected Member Functions

 TTypeBitSetBase ()=default
 
 TTypeBitSetBase (FContainer &InContainer)
 

Protected Attributes

FContainer StructTypesBitArray
 

Detailed Description

template<typename TImplementation, typename TBaseStruct, typename TStructType, typename TBitSetContainer, bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
struct TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >

Base class for managing bitsets associated with specific struct types. Provides a foundation for derived classes to handle operations like adding, removing, and checking for struct types.

Parameters
TImplementation- The derived type implementing this base class.
TBaseStruct- The base struct type for type validation.
TStructType- Unreal's struct type, typically UScriptStruct or UClass.
TBitSetContainer- The container type for storing bitsets.
bTestInheritanceAtRuntime- Flag to enable runtime inheritance checks.

Member Typedef Documentation

◆ FBaseStruct

◆ FContainer

◆ FUStructType

Constructor & Destructor Documentation

◆ TTypeBitSetBase() [1/2]

Default constructor.

◆ TTypeBitSetBase() [2/2]

Constructor accepting a container.

Parameters
InContainer- The bitset container to use.

Member Function Documentation

◆ Add()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
void TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::Add ( const FUStructType InStructType)
inline

Adds a struct type to the bitset.

Parameters
InStructType- The struct type to add.

◆ AddAtIndex()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
void TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::AddAtIndex ( const int32  StructTypeIndex)
inline

Sets the bit at index StructTypeIndex

◆ Contains()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
bool TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::Contains ( const FUStructType InStructType) const
inline

Checks if the bitset contains a specific struct type.

Parameters
InStructType- The struct type to check for.
Returns
True if the struct type is in the bitset; false otherwise.

◆ CountStoredTypes()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
int32 TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::CountStoredTypes ( ) const
inline

Counts the number of set bits in the bitset.

Returns
The number of set bits.

◆ ExportTypes()

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.

Parameters
OutTypes- The array to populate with struct types.

◆ GetAllocatedSize()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
SIZE_T TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::GetAllocatedSize ( ) const
inline

Gets the allocated size of the bitset.

Returns
The allocated memory size in bytes.

◆ GetBaseUStruct()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
static const UStruct * TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::GetBaseUStruct ( )
inlinestatic

Retrieves the base UStruct type used for validation.

Returns
Pointer to the base UStruct.

◆ GetImplementation() [1/2]

Retrieves the derived implementation of this base class.

Returns
Reference to the derived implementation.

◆ GetImplementation() [2/2]

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
const TImplementation & TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::GetImplementation ( ) const
inline

Retrieves the derived implementation of this base class (const version).

Returns
Const reference to the derived implementation.

◆ GetIndexIterator()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
FIndexIterator TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::GetIndexIterator ( const bool  bValueToCheck = true) const
inline

Creates an index iterator for bits with the specified value.

Parameters
bValueToCheck- The bit value to search for (true or false).
Returns
An iterator to traverse indices of matching bits.

◆ GetOverlap()

◆ HasAll()

◆ HasAny()

◆ HasNone()

◆ IsBitSet()

Checks if a specific bit is set in the bitset.

Parameters
BitIndex- The index of the bit to check.
Returns
True if the bit is set; false otherwise.

◆ IsEmpty()

Checks if the bitset is empty (no bits are set).

Returns
True if the bitset is empty.

◆ IsEquivalent()

Checks if the current bitset is equivalent to another, i.e., whether both contain same "true" bits and ignoring the trailing "false" bits.

Parameters
Other- The other bitset to compare.
Returns
True if both bitsets are equivalent; false otherwise.

◆ operator&()

Performs a bitwise AND operation with another bitset.

Parameters
Other- The other bitset to intersect with.
Returns
A new bitset representing the intersection.

◆ operator+()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
TImplementation TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::operator+ ( const FUStructType NewElement) const
inline

Adds a struct type to the bitset, returning a new bitset.

Parameters
NewElement- The struct type to add.
Returns
A new bitset with the added struct type.

◆ operator+=()

Adds the bits from another bitset to this one (union).

Parameters
Other- The other bitset to add.

◆ operator-()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
TImplementation TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::operator- ( const FUStructType NewElement) const
inline

Removes a struct type from the bitset, returning a new bitset.

Parameters
NewElement- The struct type to remove.
Returns
A new bitset with the struct type removed.

◆ operator-=()

Removes the bits from another bitset from this one (difference).

Parameters
Other- The other bitset to subtract.

◆ operator|()

Performs a bitwise OR operation with another bitset.

Parameters
Other- The other bitset to union with.
Returns
A new bitset representing the union.

◆ Remove()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
void TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::Remove ( const FUStructType InStructType)
inline

Removes a struct type from the bitset.

Parameters
InStructType- The struct type to remove.

◆ RemoveAtIndex()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
void TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::RemoveAtIndex ( const int32  StructTypeIndex)
inline

Clears the bit at index StructTypeIndex

◆ Reset()

Resets all bits in the bitset

◆ SetAll()

template<typename TImplementation , typename TBaseStruct , typename TStructType , typename TBitSetContainer , bool bTestInheritanceAtRuntime = WITH_STRUCTUTILS_DEBUG>
void TTypeBitSetBase< TImplementation, TBaseStruct, TStructType, TBitSetContainer, bTestInheritanceAtRuntime >::SetAll ( const bool  bValue = true)
inline

Sets all bits in the bitset to the specified value.

Parameters
bValue- The value to set for all bits (default is true).

Member Data Documentation

◆ StructTypesBitArray

The bitset container storing the bits representing struct types


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