Navigation
API > API/Runtime > API/Runtime/NetCore > API/Runtime/NetCore/Net > API/Runtime/NetCore/Net/Core
Inheritance Hierarchy
- FNetBitArrayBase
- FNetBitArray
References
| Module | NetCore |
| Header | /Engine/Source/Runtime/Net/Core/Public/Net/Core/NetBitArray.h |
| Include | #include "Net/Core/NetBitArray.h" |
Syntax
class FNetBitArray : public UE::Net::FNetBitArrayBase
Remarks
Simple bit array with internal storage. Has very little error checking as it is used in performance critical code.
Constructors
| Type | Name | Description | |
|---|---|---|---|
FNetBitArray () |
FNetBitArray Implementation. | ||
FNetBitArray
(
uint32 BitCount |
Creates an array with size BitCount bits. | ||
FNetBitArray
(
uint32 BitCountIn, |
Construct NetBitArray with the given BitCount but doesn't zero the allocated memory. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Grows the size with the specified number of bits. New bits will be cleared. | ||
| Private::FNetBitArrayRangedForConstIterator | begin () |
FNetBitArrayRangedForConstIterator implementation. | |
| void | Clear the bit with the specified index | ||
| void | Clear the bits in the specified range | ||
| void | Combine
(
const FNetBitArray& Other, |
Combine this array with another array using a word operation functor. Bit counts need to match. | |
| void | CombineMultiple
(
WordOpFunctor1&& Op, |
Combine this array with the result of a bitwise operation of two other arrays. | |
| void | Copy
(
const FNetBitArrayView& Other |
||
| void | Copy
(
const FNetBitArray& Other |
Copy bits from other bit array. The other array must have the same bit count. | |
| uint32 | CountSetBits
(
uint32 StartIndex, |
Counts the number of set bits in this array in the provided range. | |
| void | Empty () |
Release all memory and set capacity to 0 bits | |
| Private::FNetBitArrayRangedForConstIterator | end () |
||
| uint32 | FindFirstOne () |
Find first set bit. Returns InvalidIndex if no zero bit was found | |
| uint32 | FindFirstOne
(
uint32 StartIndex |
Find first set bit starting from StartIndex. Returns InvalidIndex if no set bit was found. | |
| uint32 | Find first zero bit. Returns InvalidIndex if no zero bit was found | ||
| uint32 | FindFirstZero
(
uint32 StartIndex |
Find first zero bit starting from StartIndex. Returns InvalidIndex if no zero bit was found. | |
| uint32 | FindLastOne () |
Find last set bit. Returns InvalidIndex if no set bit was found. | |
| uint32 | FindLastZero () |
Find last zero bit. Returns InvalidIndex if no zero bit was found. | |
| void | ForAllExclusiveBits
(
const FNetBitArray& 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. | |
| void | ForAllSetBits
(
T&& Functor |
Iterate over all set bits and invoke functor with signature void(uint32 BitIndex). | |
| void | ForAllSetBits
(
const FNetBitArray& A, |
Iterate over all words and execute Functor, with signature void(uint32 BitIndex), for all set bits after executing WordOpFunctor | |
| bool | Get the bit with the specified index | ||
| StorageWordType * | GetData () |
Returns a pointer to the internal storage. | |
| const StorageWordType * | GetData () |
Returns a pointer to the internal storage. | |
| uint32 | GetNumBits () |
Returns the number of bits | |
| uint32 | GetNumWords () |
Returns the number of words in our storage | |
| uint32 | GetSetBitIndices
(
uint32 StartIndex, |
Retrieves set bits in the provided range and returns how many indices were written to OutIndices. | |
| void | Sets a new size and resets the array's contents. | ||
| void | InitAndCopy
(
const FNetBitArrayView& Source |
||
| void | InitAndCopy
(
const FNetBitArray& Source |
Initialize a bit array with another array. | |
| bool | IsAnyBitSet
(
uint32 StartIndex, |
Returns true if any bit is set in the specified range. | |
| bool | IsAnyBitSet () |
Returns true if any bit is set in the bitset. | |
| bool | Return if a specified bit is set or not | ||
| bool | IsNoBitSet () |
Returns true if no bit is set in the bitset. Note: Padding bits in storage are expected to be zero. | |
| void | Reset () |
Clear all bits in the array. | |
| void | Set
(
const FNetBitArray& First, |
Overwrite this bit array with the result of a word operation from two other arrays | |
| void | SetAllBits () |
Sets all bits in the array, but clears padding bits. | |
| void | Set the bit with the specified index | ||
| void | Set the bit with the specified index to bValue | ||
| void | SetBitValue
(
uint32 Index, |
Set the bit with the specified index to bValue | |
| void | SetNumBits
(
uint32 BitCount |
Sets the number of bits to BitCount. | |
| FString | ToString () |
Only prints the amount of set bits in the array. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| bool | operator==
(
const FNetBitArray& Other |
Return true if equal including BitCount and padding bits |