UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage > Struct Template Reference

#include <SparseBitSet.h>

Classes

struct  FIterator
 

Public Types

using BucketType = typename BucketStorage::BucketType
 

Public Member Functions

 TFixedSparseBitSet ()
 
template<typename ... StorageArgs>
 TFixedSparseBitSet (StorageArgs &&...Storage)
 
 TFixedSparseBitSet (const TFixedSparseBitSet &)=default
 
TFixedSparseBitSetoperator= (const TFixedSparseBitSet &)=default
 
 TFixedSparseBitSet (TFixedSparseBitSet &&)=default
 
TFixedSparseBitSetoperator= (TFixedSparseBitSet &&)=default
 
template<typename OtherHashType , typename OtherStorageType >
void CopyTo (TFixedSparseBitSet< OtherHashType, OtherStorageType > &Other) const
 
template<typename OtherHashType , typename OtherStorageType >
void CopyToUnsafe (TFixedSparseBitSet< OtherHashType, OtherStorageType > &Other, uint32 OtherBucketCapacity) const
 
TFixedSparseBitSetoperator|= (const TFixedSparseBitSet &Other)
 
uint32 NumBuckets () const
 
uint32 CountSetBits () const
 
uint32 GetMaxNumBits () const
 
bool IsEmpty () const
 
ESparseBitSetBitResult SetBit (uint32 BitIndex)
 
bool IsBitSet (uint32 BitIndex) const
 
int32 GetSparseBucketIndex (uint32 BitIndex) const
 

Static Public Attributes

static constexpr uint32 HashSize = sizeof(HashType)*8
 
static constexpr uint32 BucketSize = sizeof(typename BucketStorage::BucketType)*8
 
static constexpr uint32 MaxNumBits = HashSize * BucketSize
 

Friends

template<typename , typename >
struct TFixedSparseBitSet
 
FIterator begin (const TFixedSparseBitSet< HashType, BucketStorage > &In)
 
FIterator end (const TFixedSparseBitSet< HashType, BucketStorage > &In)
 

Detailed Description

template<typename HashType, typename BucketStorage>
struct UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >

NOTE: This class is currently considered internal only, and should only be used by engine code. A sparse bitset comprising a hash of integer indexes with set bits, and a sparse array of unsigned integers (referred to as buckets) whose width is defined by the storage.

The maximum size bitfield that is representible by this bitset is defined as sizeof(HashType)*sizeof(BucketStorage::BucketType). For example, a 64 bit hash with 32 bit buckets can represent a bitfield of upto 2048 bits.

The hash allows for empty buckets to be completely omitted from memory, and affords very fast comparison for buckets that have no set bits. This container is specialized for relatively large bitfields that have small numbers of set bits (ie, needles in haystacks) as they will provide the best memory vs CPU tradeoffs.

Member Typedef Documentation

◆ BucketType

template<typename HashType , typename BucketStorage >
using UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::BucketType = typename BucketStorage::BucketType

Constructor & Destructor Documentation

◆ TFixedSparseBitSet() [1/4]

template<typename HashType , typename BucketStorage >
UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::TFixedSparseBitSet ( )
inlineexplicit

◆ TFixedSparseBitSet() [2/4]

template<typename HashType , typename BucketStorage >
template<typename ... StorageArgs>
UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::TFixedSparseBitSet ( StorageArgs &&...  Storage)
inlineexplicit

◆ TFixedSparseBitSet() [3/4]

template<typename HashType , typename BucketStorage >
UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::TFixedSparseBitSet ( const TFixedSparseBitSet< HashType, BucketStorage > &  )
default

◆ TFixedSparseBitSet() [4/4]

template<typename HashType , typename BucketStorage >
UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::TFixedSparseBitSet ( TFixedSparseBitSet< HashType, BucketStorage > &&  )
default

Member Function Documentation

◆ CopyTo()

◆ CopyToUnsafe()

template<typename HashType , typename BucketStorage >
void UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::CopyToUnsafe ( TFixedSparseBitSet< OtherHashType, OtherStorageType > &  Other,
uint32  OtherBucketCapacity 
) const
inline

Copy this bitset to another without resizing the destination's bucket storage. Bucket storage must be >= this size.

◆ CountSetBits()

template<typename HashType , typename BucketStorage >
uint32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::CountSetBits ( ) const
inline

◆ GetMaxNumBits()

template<typename HashType , typename BucketStorage >
uint32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::GetMaxNumBits ( ) const
inline

◆ GetSparseBucketIndex()

template<typename HashType , typename BucketStorage >
int32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::GetSparseBucketIndex ( uint32  BitIndex) const
inline

Get the sparse bucket index of the specified bit

◆ IsBitSet()

template<typename HashType , typename BucketStorage >
bool UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::IsBitSet ( uint32  BitIndex) const
inline

Check whether the specified bit index is set

◆ IsEmpty()

template<typename HashType , typename BucketStorage >
bool UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::IsEmpty ( ) const
inline

◆ NumBuckets()

template<typename HashType , typename BucketStorage >
uint32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::NumBuckets ( ) const
inline

Count the number of buckets in this bitset

◆ operator=() [1/2]

template<typename HashType , typename BucketStorage >
TFixedSparseBitSet & UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::operator= ( const TFixedSparseBitSet< HashType, BucketStorage > &  )
default

◆ operator=() [2/2]

template<typename HashType , typename BucketStorage >
TFixedSparseBitSet & UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::operator= ( TFixedSparseBitSet< HashType, BucketStorage > &&  )
default

◆ operator|=()

template<typename HashType , typename BucketStorage >
TFixedSparseBitSet & UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::operator|= ( const TFixedSparseBitSet< HashType, BucketStorage > &  Other)
inline

◆ SetBit()

template<typename HashType , typename BucketStorage >
ESparseBitSetBitResult UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::SetBit ( uint32  BitIndex)
inline

Set the bit at the specified index. Any bits between Num and BitIndex will be considered 0.

Returns
true if the bit was previously considered 0 and is now set, false if it was already set.

Friends And Related Symbol Documentation

◆ begin

template<typename HashType , typename BucketStorage >
FIterator begin ( const TFixedSparseBitSet< HashType, BucketStorage > &  In)
friend

◆ end

template<typename HashType , typename BucketStorage >
FIterator end ( const TFixedSparseBitSet< HashType, BucketStorage > &  In)
friend

◆ TFixedSparseBitSet

template<typename HashType , typename BucketStorage >
template<typename , typename >
friend struct TFixedSparseBitSet
friend

Member Data Documentation

◆ BucketSize

template<typename HashType , typename BucketStorage >
constexpr uint32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::BucketSize = sizeof(typename BucketStorage::BucketType)*8
staticconstexpr

◆ HashSize

template<typename HashType , typename BucketStorage >
constexpr uint32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::HashSize = sizeof(HashType)*8
staticconstexpr

◆ MaxNumBits

template<typename HashType , typename BucketStorage >
constexpr uint32 UE::MovieScene::TFixedSparseBitSet< HashType, BucketStorage >::MaxNumBits = HashSize * BucketSize
staticconstexpr

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