Navigation
API > API/Runtime > API/Runtime/NetCore
Simple bit array view. Assumes external storage and has very little error checking as it is used in performance critical code. Note: Trailing padding bits in storage will be zeroed unless the view is explicitly constructed to allow it. Certain operations assume the padding bits are cleared.
| Name | FNetBitArrayView |
| Type | class |
| Header File | /Engine/Source/Runtime/Net/Core/Public/Net/Core/NetBitArray.h |
| Include Path | #include "Net/Core/NetBitArray.h" |
Syntax
class FNetBitArrayView : public UE::Net::FNetBitArrayBase
Inheritance Hierarchy
- FNetBitArrayBase → FNetBitArrayView
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FNetBitArrayView
(
StorageWordType* StorageIn, |
Construct NetBitArray from external storage. | Net/Core/NetBitArray.h | |
FNetBitArrayView
(
StorageWordType* StorageIn, |
Construct NetBitArray from external storage. | Net/Core/NetBitArray.h | |
FNetBitArrayView
(
StorageWordType* StorageIn, |
Construct NetBitArray from external storage. | Net/Core/NetBitArray.h | |
| Constructor will produce a valid but empty bitarray. | Net/Core/NetBitArray.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BitCount | uint32 | Net/Core/NetBitArray.h | ||
| Storage | StorageWordType * | Net/Core/NetBitArray.h | ||
| WordCount | uint32 | Net/Core/NetBitArray.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AndBitValue
(
uint32 Index, |
Do an And operation on the specified index | Net/Core/NetBitArray.h | |
| DO NOT USE DIRECTLY Range-based for loop support iterating over set bits and returning the index to the set bit. | Net/Core/NetBitArray.h | ||
void ClearAllBits() |
Clear all bits to zero | Net/Core/NetBitArray.h | |
void ClearBit
(
uint32 Index |
Clear the bit with the specified index | Net/Core/NetBitArray.h | |
void ClearBits
(
uint32 StartIndex, |
Clear the bits in the specified range | Net/Core/NetBitArray.h | |
void ClearPaddingBits() |
All padding bits will be set to zero | Net/Core/NetBitArray.h | |
void Combine
(
const FNetBitArrayView& Other, |
Combine this array with another array using a word operation functor. Bit counts need to match. | Net/Core/NetBitArray.h | |
void CombineMultiple
(
WordOpFunctor1&& Op, |
Combine this array with the result of a bitwise operation of two other arrays. | Net/Core/NetBitArray.h | |
void Copy
(
const FNetBitArrayView& Other |
Copy bits from other bit array. The other array must have the same bit count. | Net/Core/NetBitArray.h | |
void Copy
(
const FNetBitArray& Other |
Net/Core/NetBitArray.h | ||
uint32 CountSetBits
(
uint32 StartIndex, |
Counts the number of set bits in this array in the provided range. | Net/Core/NetBitArray.h | |
| Net/Core/NetBitArray.h | |||
uint32 FindFirstOne
(
uint32 StartIndex |
Find first set bit starting from StartIndex. Returns InvalidIndex if no set bit was found. | Net/Core/NetBitArray.h | |
uint32 FindFirstOne () |
Find first set bit. Returns InvalidIndex if no zero bit was found | Net/Core/NetBitArray.h | |
uint32 FindFirstZero () |
Find first zero bit. Returns InvalidIndex if no zero bit was found | Net/Core/NetBitArray.h | |
uint32 FindFirstZero
(
uint32 StartIndex |
Find first zero bit starting from StartIndex. Returns InvalidIndex if no zero bit was found. | Net/Core/NetBitArray.h | |
uint32 FindLastOne() |
Find last set bit. Returns InvalidIndex if no set bit was found. | Net/Core/NetBitArray.h | |
uint32 FindLastZero() |
Find last zero bit. Returns InvalidIndex if no zero bit was found. | Net/Core/NetBitArray.h | |
void ForAllSetBits
(
T&& Functor |
Iterate over all set bits and invoke functor with signature void(uint32 BitIndex). | Net/Core/NetBitArray.h | |
void ForAllSetBitsInRange
(
const uint32 StartBit, |
Iterate over all set bits from StartBit to EndBit (inclusive) and invoke functor with signature void(uint32 BitIndex). | Net/Core/NetBitArray.h | |
void ForAllUnsetBits
(
T&& Functor |
Iterate over all the zero bits and invoke functor with signature void(uint32 BitIndex). | Net/Core/NetBitArray.h | |
bool GetBit
(
uint32 Index |
Get the bit with the specified index | Net/Core/NetBitArray.h | |
StorageWordType * GetData () |
Returns a pointer to the internal storage. It's safer to use GetWord() or GetDataChecked() instead. | Net/Core/NetBitArray.h | |
const StorageWordType * GetData () |
Returns a pointer to the internal storage. It's safer to use GetWord() or GetDataChecked() instead. | Net/Core/NetBitArray.h | |
StorageWordType * GetDataChecked
(
uint32 MaxWordIterationCount |
Returns a pointer to the internal storage but validates that the array buffer is the expected size. | Net/Core/NetBitArray.h | |
const StorageWordType * GetDataChecked
(
uint32 MaxWordIterationCount |
Returns a pointer to the internal storage but validates that the array buffer is the expected size. | Net/Core/NetBitArray.h | |
uint32 GetNumBits() |
Returns the number of bits | Net/Core/NetBitArray.h | |
uint32 GetNumWords() |
Returns the number of words in our storage | Net/Core/NetBitArray.h | |
uint32 GetSetBitIndices
(
uint32 StartIndex, |
Retrieves set bits in the provided range and returns how many indices were written to OutIndices. | Net/Core/NetBitArray.h | |
StorageWordType GetWord
(
uint32 WordIndex |
Read an entire word. Useful when you want to read 'WordBitCount(32)' bits at once | Net/Core/NetBitArray.h | |
StorageWordType & GetWord
(
uint32 WordIndex |
Access an entire word. Useful when you want to write 'WordBitCount(32)' bits at once | Net/Core/NetBitArray.h | |
bool IsAnyBitSet
(
uint32 StartIndex, |
Returns true if any bit is set in the specified range. | Net/Core/NetBitArray.h | |
bool IsAnyBitSet () |
Returns true if any bit is set in the bitset Note: Padding bits in storage are expected to be zero. | Net/Core/NetBitArray.h | |
bool IsBitSet
(
uint32 Index |
Return if a specific bit is set or not | Net/Core/NetBitArray.h | |
bool IsNoBitSet() |
Returns true if no bit is set in the bitset. Note: Padding bits in storage are expected to be zero. | Net/Core/NetBitArray.h | |
void OrBitValue
(
uint32 Index, |
Do an Or operation on the specified index | Net/Core/NetBitArray.h | |
void Reset() |
Reset the storage of the BitArray including any padding bits | Net/Core/NetBitArray.h | |
void Set
(
const FNetBitArrayView& First, |
Overwrite this bit array with the result of a word operation from two other arrays | Net/Core/NetBitArray.h | |
void SetAllBits() |
Set all bits, padding bits will be zeroed | Net/Core/NetBitArray.h | |
void SetBit
(
uint32 Index |
Set the bit with the specified index | Net/Core/NetBitArray.h | |
void SetBits
(
uint32 StartIndex, |
Set the bits in the specified range to true | Net/Core/NetBitArray.h | |
void SetBitValue
(
uint32 Index, |
Set the bit with the specified index to bValue | Net/Core/NetBitArray.h | |
| Only prints the amount of set bits in the array. | Net/Core/NetBitArray.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static uint32 CalculateRequiredWordCount
(
uint32 BitCount |
NetBitArrayView implementation. | Net/Core/NetBitArray.h | |
static void ForAllExclusiveBits
(
const FNetBitArrayView& A, |
Compare two BitArrays bit by bit and invoke FunctorA(BitIndex) for bits set only in array A and invoke FunctorB(BitIndex) for bits set only in array B. | Net/Core/NetBitArray.h | |
static void ForAllExclusiveBitsByPredicate
(
const FNetBitArrayView& A, |
Compare two BitArrays bit by bit. | Net/Core/NetBitArray.h | |
static void ForAllSetBits
(
const FNetBitArrayView& A, |
Iterate over all words and execute Functor, with signature void(uint32 BitIndex), for all set bits after executing WordOpFunctor | Net/Core/NetBitArray.h | |
static void ForAllSetBitsMultiple
(
const FNetBitArrayView& A, |
Call the functor for every bit still set after the following operation: "A Op1 (B Op2 C)" | Net/Core/NetBitArray.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator==
(
const FNetBitArrayView& Other |
Return true if equal including BitCount and padding bits | Net/Core/NetBitArray.h |