A dynamically sized bit array. 更多...
#include <BitArray.h>
类 | |
| class | FConstIterator |
| Const BitArray iterator. 更多... | |
| class | FConstReverseIterator |
| Const reverse iterator. 更多... | |
| class | FIterator |
| BitArray iterator. 更多... | |
Public 成员函数 | |
| int32 | Add (const bool Value) |
| Adds a bit to the array with the given value. 更多... | |
| int32 | Add (const bool Value, int32 NumBitsToAdd) |
| Adds multiple bits to the array with the given value. 更多... | |
| template<typename InWordType > | |
| int32 | AddRange (const InWordType *ReadBits, int32 NumBitsToAdd, int32 ReadOffsetBits=0) |
| Adds multiple bits read from the given pointer. 更多... | |
| template<typename OtherAllocator > | |
| int32 | AddRange (const TBitArray< OtherAllocator > &ReadBits, int32 NumBitsToAdd, int32 ReadOffsetBits=0) |
| Adds multiple bits read from the given BitArray. 更多... | |
| int32 | AddUninitialized (int32 NumBitsToAdd) |
| Inserts space for multiple bits at the end of the array. 更多... | |
| void | BitwiseNOT () |
| Perform a bitwise NOT on all the bits in this array | |
| void | CheckInvariants () const |
| Checks the invariants of this class | |
| TBitArray & | CombineWithBitwiseAND (const TBitArray &InOther, EBitwiseOperatorFlags InFlags) |
| Perform a bitwise AND on this bit array with another. 更多... | |
| TBitArray & | CombineWithBitwiseOR (const TBitArray &InOther, EBitwiseOperatorFlags InFlags) |
| Return the bitwise OR of two bit arrays. 更多... | |
| TBitArray & | CombineWithBitwiseXOR (const TBitArray &InOther, EBitwiseOperatorFlags InFlags) |
| Return the bitwise XOR of two bit arrays. 更多... | |
| bool | CompareSetBits (const TBitArray &Other, const bool bMissingBitValue) const |
| Returns true if Other contains all the same set bits as this, accounting for differences in length. 更多... | |
| void | CountBytes (FArchive &Ar) const |
| Tracks the container's memory use through an archive. | |
| int32 | CountSetBits (int32 FromIndex=0, int32 ToIndex=INDEX_NONE) const |
| Count the number of set bits in this array FromIndex <= bit < ToIndex | |
| void | Empty (int32 ExpectedNumBits=0) |
| Removes all bits from the array, potentially leaving space allocated for an expected number of bits about to be added. 更多... | |
| int32 | Find (bool bValue) const |
| Finds the first true/false bit in the array, and returns the bit index. 更多... | |
| int32 | FindAndSetFirstZeroBit (int32 ConservativeStartIndex=0) |
| Finds the first zero bit in the array, sets it to true, and returns the bit index. 更多... | |
| int32 | FindAndSetLastZeroBit () |
| Finds the last zero bit in the array, sets it to true, and returns the bit index. 更多... | |
| int32 | FindLast (bool bValue) const |
| Finds the last true/false bit in the array, and returns the bit index. 更多... | |
| uint32 | GetAllocatedSize (void) const |
| Helper function to return the amount of memory allocated by this container 更多... | |
| template<typename InWordType > | |
| FORCEINLINE void | GetRange (int32 Index, int32 NumBitsToGet, InWordType *WriteBits, int32 WriteOffsetBits=0) const |
| Reads a range of bits within the array and writes them to the given pointer. 更多... | |
| FORCEINLINE void | Init (bool bValue, int32 InNumBits) |
| Resets the array's contents. 更多... | |
| void | Insert (bool Value, int32 Index) |
| Adds a bit with the given value at the given index in the array. 更多... | |
| void | Insert (bool Value, int32 Index, int32 NumBitsToAdd) |
| Inserts multiple bits with the given value into the array, starting at the given Index. 更多... | |
| template<typename InWordType > | |
| void | InsertRange (const InWordType *ReadBits, int32 Index, int32 NumBitsToAdd, int32 ReadOffsetBits=0) |
| Inserts multiple bits read from the given pointer, starting at the given index. 更多... | |
| template<typename OtherAllocator > | |
| void | InsertRange (const TBitArray< OtherAllocator > &ReadBits, int32 Index, int32 NumBitsToAdd, int32 ReadOffsetBits=0) |
| Inserts multiple bits read from the given BitArray into the array, starting at the given index. 更多... | |
| void | InsertUninitialized (int32 Index, int32 NumBitsToAdd) |
| Inserts space for multiple bits into the array, starting at the given index. 更多... | |
| FORCEINLINE TBitArray & | operator= (const TBitArray &Copy) |
| Assignment operator. | |
| FORCEINLINE TBitArray & | operator= (TBitArray &&Other) |
| Move assignment. | |
| int32 | PadToNum (int32 DesiredNum, bool bPadValue) |
| Pad this bit array with the specified value to ensure that it is at least the specified length. 更多... | |
| void | RemoveAt (int32 BaseIndex, int32 NumBitsToRemove=1) |
| Removes bits from the array. 更多... | |
| void | Reserve (int32 Number) |
| Reserves memory such that the array can contain at least Number bits. 更多... | |
| void | Reset () |
| Removes all bits from the array retaining any space already allocated. | |
| void | SetNumUninitialized (int32 InNumBits) |
| Sets number of bits without initializing new bits. | |
| FORCENOINLINE void | SetRange (int32 Index, int32 NumBitsToSet, bool Value) |
| Sets or unsets a range of bits within the array. 更多... | |
| template<typename InWordType > | |
| void | SetRangeFromRange (int32 Index, int32 NumBitsToSet, const InWordType *ReadBits, int32 ReadOffsetBits=0) |
| Sets range of bits within the TBitArray to the values read out of a pointer. 更多... | |
| template<typename OtherAllocator > | |
| FORCEINLINE void | SetRangeFromRange (int32 Index, int32 NumBitsToSet, const TBitArray< OtherAllocator > &ReadBits, int32 ReadOffsetBits=0) |
| Sets range of bits within this TBitArray to the values read out another TBitArray. 更多... | |
| FORCEINLINE | TBitArray (bool bValue, int32 InNumBits) |
| Minimal initialization constructor. 更多... | |
| FORCEINLINE | TBitArray (const TBitArray &Copy) |
| Copy constructor. | |
| FORCEINLINE | TBitArray (TBitArray &&Other) |
| Move constructor. | |
静态 Public 成员函数 | |
| static TBitArray | BitwiseAND (const TBitArray &A, const TBitArray &B, EBitwiseOperatorFlags InFlags) |
| Return the bitwise AND of two bit arrays. 更多... | |
| static TBitArray | BitwiseOR (const TBitArray &A, const TBitArray &B, EBitwiseOperatorFlags InFlags) |
| Return the bitwise OR of two bit arrays. 更多... | |
| static TBitArray | BitwiseXOR (const TBitArray &A, const TBitArray &B, EBitwiseOperatorFlags InFlags) |
| Return the bitwise XOR of two bit arrays. 更多... | |
友元 | |
| FArchive & | operator<< (FArchive &Ar, TBitArray &BitArray) |
| Serializer | |
| template<typename , typename , bool > | |
| class | TConstDualSetBitIterator |
| template<typename > | |
| class | TConstSetBitIterator |
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.
|
inlineexplicit |
Minimal initialization constructor.
| Value | - The value to initial the bits to. |
| InNumBits | - The initial number of bits in the array. |
|
inline |
Adds a bit to the array with the given value.
|
inline |
Adds multiple bits to the array with the given value.
|
inline |
Adds multiple bits read from the given pointer.
| ReadBits | The address of sized integers to read the bits from. Bits are read from ReadBits in the current platform's mathematical bitorder (ReadBits[0] & 0x1, ReadBits[0] & 0x2, ... ReadBits[0] & 0x100, ... ReadBits[0] & 0x80000000, ReadBits[1] & 0x1 ... |
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
| ReadOffsetBits | Number of bits into ReadBits at which to start reading. Must be >= 0. |
|
inline |
Adds multiple bits read from the given BitArray.
| ReadBits | The value to set the bits to. |
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
| ReadOffsetBits | Number of bits into ReadBits at which to start reading. Must be >= 0. |
|
inline |
Inserts space for multiple bits at the end of the array.
The inserted bits are set to arbitrary values and should be written using SetRange or otherwise before being read.
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
|
inlinestatic |
Return the bitwise AND of two bit arrays.
The resulting bit array will be sized according to InFlags.
|
inlinestatic |
Return the bitwise OR of two bit arrays.
The resulting bit array will be sized according to InFlags.
|
inlinestatic |
Return the bitwise XOR of two bit arrays.
The resulting bit array will be sized according to InFlags.
|
inline |
Perform a bitwise AND on this bit array with another.
This array receives the result and will be sized max(A.Num(), B.Num()).
|
inline |
Return the bitwise OR of two bit arrays.
The resulting bit array will be sized according to InFlags.
|
inline |
Return the bitwise XOR of two bit arrays.
The resulting bit array will be sized according to InFlags.
|
inline |
Returns true if Other contains all the same set bits as this, accounting for differences in length.
Similar to operator== but can handle different length arrays by zero or one-filling missing bits.
| Other | The array to compare against |
| bMissingBitValue | The value to use for missing bits when considering bits that are outside the range of either array |
|
inline |
Removes all bits from the array, potentially leaving space allocated for an expected number of bits about to be added.
| ExpectedNumBits | - The expected number of bits about to be added. |
|
inline |
Finds the first true/false bit in the array, and returns the bit index.
If there is none, INDEX_NONE is returned.
|
inline |
Finds the first zero bit in the array, sets it to true, and returns the bit index.
If there is none, INDEX_NONE is returned.
|
inline |
Finds the last zero bit in the array, sets it to true, and returns the bit index.
If there is none, INDEX_NONE is returned.
|
inline |
Finds the last true/false bit in the array, and returns the bit index.
If there is none, INDEX_NONE is returned.
|
inline |
Helper function to return the amount of memory allocated by this container
|
inline |
Reads a range of bits within the array and writes them to the given pointer.
| Index | The index of the first bit to read; must be 0 <= Index <= Num(). |
| NumBitsToGet | The number of bits to read, must satisify 0 <= NumBitsToGet && Index + NumBitsToGet <= Num(). |
| WriteBits | The address of sized integers to write the bits to. Bits are written into WriteBits in the current platform's mathematical bitorder (WriteBits[0] & 0x1, WriteBits[0] & 0x2, ... WriteBits[0] & 0x100, ... WriteBits[0] & 0x80000000, WriteBits[1] & 0x1 ... |
| WriteOffsetBits | Number of bits into WriteBits at which to start writing. |
|
inline |
Resets the array's contents.
Use TBitArray(bool bValue, int32 InNumBits) instead of default constructor and Init().
| Value | - The value to initial the bits to. |
| NumBits | - The number of bits in the array. |
|
inline |
Adds a bit with the given value at the given index in the array.
| Value | The value of the bit to add |
| Index | - The index at which to add; must be 0 <= Index <= Num(). |
|
inline |
Inserts multiple bits with the given value into the array, starting at the given Index.
| Value | The value of the bits to add |
| Index | The index at which to add; must be 0 <= Index <= Num(). |
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
|
inline |
Inserts multiple bits read from the given pointer, starting at the given index.
| ReadBits | The address of sized integers to read the bits from. Bits are read from ReadBits in the current platform's mathematical bitorder (ReadBits[0] & 0x1, ReadBits[0] & 0x2, ... ReadBits[0] & 0x100, ... ReadBits[0] & 0x80000000, ReadBits[1] & 0x1 ... |
| Index | The index at which to add; must be 0 <= Index <= Num(). |
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
| ReadOffsetBits | Number of bits into ReadBits at which to start reading. |
|
inline |
Inserts multiple bits read from the given BitArray into the array, starting at the given index.
| ReadBits | The value to set the bits to. |
| Index | The index at which to add; must be 0 <= Index <= Num(). |
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
| ReadOffsetBits | Number of bits into ReadBits at which to start reading. |
|
inline |
Inserts space for multiple bits into the array, starting at the given index.
The inserted bits are set to arbitrary values and should be written using SetRange or otherwise before being read.
| Index | The index at which to add; must be 0 <= Index <= Num(). |
| NumBitsToAdd | The number of bits to add. Must be >= 0. |
|
inline |
Pad this bit array with the specified value to ensure that it is at least the specified length.
Does nothing if Num() >= DesiredNum.
| DesiredNum | The desired number of elements that should exist in the array. |
| bPadValue | The value to pad with (0 or 1) |
|
inline |
Removes bits from the array.
| BaseIndex | - The index of the first bit to remove. |
| NumBitsToRemove | - The number of consecutive bits to remove. |
|
inline |
Reserves memory such that the array can contain at least Number bits.
@Number The number of bits to reserve space for.
|
inline |
Sets or unsets a range of bits within the array.
| Index | The index of the first bit to set; must be 0 <= Index <= Num(). |
| NumBitsToSet | The number of bits to set, must satisify Index + NumBitsToSet <= Num(). |
| Value | The value to set the bits to. |
|
inline |
Sets range of bits within the TBitArray to the values read out of a pointer.
| Index | The index of the first bit to set; must be 0 <= Index <= Num(). |
| NumBitsToSet | The number of bits to set, must satisify 0 <= NumBitsToSet && Index + NumBitsToSet <= Num(). |
| ReadBits | The address of sized integers to read the bits from. Bits are read from ReadBits in the current platform's mathematical bitorder (ReadBits[0] & 0x1, ReadBits[0] & 0x2, ... ReadBits[0] & 0x100, ... ReadBits[0] & 0x80000000, ReadBits[1] & 0x1 ... |
| ReadOffsetBits | Number of bits into ReadBits at which to start reading. |
|
inline |
Sets range of bits within this TBitArray to the values read out another TBitArray.
| Index | The index of the first bit to set; must be 0 <= Index <= Num(). |
| NumBitsToSet | The number of bits to set, must satisify 0 <= NumBitsToSet && Index + NumBitsToSet <= Num(). |
| ReadBits | The value to set the bits to. |
| ReadOffsetBits | Number of bits into ReadBits at which to start reading. |