TBitArray

Forward declaration.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/BitArray.h

Include

#include "Containers/BitArray.h"

Syntax

template<typename Allocator>
class TBitArray

Remarks

A dynamically sized bit array. An array of Booleans. They stored in one bit/Boolean. There are iterators that efficiently iterate over only set bits.

Constructors

Name Description

Public function

TBitArray

(
    TBitArray&& Other
)

Move constructor.

Public function

TBitArray

(
    const TBitArray& Copy
)

Copy constructor.

Public function

TBitArray

(
    const bool Value,
    const int32 InNumBits
)

Minimal initialization constructor.

Functions

Name Description

Public function Const

const FConst...

 

AccessCorrespondingBit

(
    const FRelativeBitReference& Relat...
)

Public function

FBitReferenc...

 

AccessCorrespondingBit

(
    const FRelativeBitReference& Relat...
)

Public function

int32

 

Add

(
    const bool Value,
    int32 NumToAdd
)

Adds multiple bits to the array with the given value.

Public function

int32

 

Add

(
    const bool Value
)

Adds a bit to the array with the given value.

Public function Const

bool

 

Contains

(
    bool bValue
)

Public function Const

void

 

CountBytes

(
    FArchive& Ar
)

Tracks the container's memory use through an archive.

Public function

void

 

Empty

(
    int32 ExpectedNumBits
)

Removes all bits from the array, potentially leaving space allocated for an expected number of bits about to be added.

Public function Const

int32

 

Find

(
    bool bValue
)

Finds the first true/false bit in the array, and returns the bit index.

Public function

int32

 

FindAndSetFirstZeroBit

(
    int32 ConservativeStartIndex
)

Finds the first zero bit in the array, sets it to true, and returns the bit index.

Public function

int32

 

FindAndSetLastZeroBit()

Finds the last zero bit in the array, sets it to true, and returns the bit index.

Public function Const

int32

 

FindLast

(
    bool bValue
)

Finds the last true/false bit in the array, and returns the bit index.

Public function Const

uint32

 

GetAllocatedSize()

Helper function to return the amount of memory allocated by this container

Public function

uint32 *

 

GetData()

Public function Const

const uint32...

 

GetData()

Public function

void

 

Init

(
    bool Value,
    int32 InNumBits
)

Resets the array's contents.

Public function Const

bool

 

IsValidIndex

(
    int32 InIndex
)

Accessors.

Public function Const

int32

 

Num()

Public function

void

 

RemoveAt

(
    int32 BaseIndex,
    int32 NumBitsToRemove
)

Removes bits from the array.

Public function

void

 

RemoveAtSwap

(
    int32 BaseIndex,
    int32 NumBitsToRemove
)

Removes bits from the array by swapping them with bits at the end of the array.

Public function

void

 

Reserve

(
    int32 Number
)

Reserves memory such that the array can contain at least Number bits.

Public function

void

 

Reset()

Removes all bits from the array retaining any space already allocated.

Public function

void

 

SetRange

(
    int32 Index,
    int32 Num,
    bool Value
)

Sets or unsets a range of bits within the array.

Operators

Name Description

Public function

bool

 

operator!=

(
    const TBitArray< Allocator >& Othe...
)

Public function Const

const FConst...

 

operator[]

(
    int32 Index
)

Public function

FBitReferenc...

 

operator[]

(
    int32 Index
)

Public function Const

bool

 

operator<

(
    const TBitArray< Allocator >& Othe...
)

Public function

TBitArray &

 

operator=

(
    const TBitArray& Copy
)

Assignment operator.

Public function

TBitArray &

 

operator=

(
    TBitArray&& Other
)

Move assignment.

Public function Const

bool

 

operator==

(
    const TBitArray< Allocator >& Othe...
)

Classes

Name

Description

Public class

FConstIterator

Const BitArray iterator.

Public class

FConstReverseIterator

Const reverse iterator.

Public class

FIterator

BitArray iterator.

Typedefs

Name

Description

AllocatorType

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback