Ark Server API (ASA) - Wiki
|
#include <BitArray.h>
Classes | |
class | FConstIterator |
class | FConstReverseIterator |
struct | FConstWordIterator |
class | FIterator |
struct | FWordIterator |
struct | TSupportsFreezeMemoryImageHelper |
struct | TSupportsFreezeMemoryImageHelper< true, Dummy > |
struct | TWordIteratorBase |
Public Types | |
typedef Allocator::template ForElementType< uint32 > | AllocatorType |
Static Public Member Functions | |
static TBitArray | BitwiseAND (const TBitArray &A, const TBitArray &B, EBitwiseOperatorFlags InFlags) |
static TBitArray | BitwiseOR (const TBitArray &A, const TBitArray &B, EBitwiseOperatorFlags InFlags) |
static TBitArray | BitwiseXOR (const TBitArray &A, const TBitArray &B, EBitwiseOperatorFlags InFlags) |
Private Types | |
typedef uint32 | WordType |
Private Member Functions | |
FORCEINLINE uint32 | GetNumWords () const |
FORCEINLINE uint32 | GetMaxWords () const |
FORCEINLINE uint32 | GetLastWordMask () const |
template<typename OtherAllocator > | |
void | Assign (const TBitArray< OtherAllocator > &Other) |
FORCENOINLINE void | Realloc (int32 PreviousNumBits) |
void | SetBitNoCheck (int32 Index, bool Value) |
void | ClearPartialSlackBits () |
Static Private Member Functions | |
static FORCEINLINE void | SetWords (uint32 *Words, int32 NumWords, bool bValue) |
template<typename BitArrayType > | |
static FORCEINLINE void | Move (BitArrayType &ToArray, BitArrayType &FromArray) |
template<typename ProjectionType > | |
static void | BitwiseBinaryOperatorImpl (const TBitArray &InA, const TBitArray &InB, TBitArray &OutResult, EBitwiseOperatorFlags InFlags, ProjectionType &&InProjection) |
template<typename ProjectionType > | |
static void | BitwiseOperatorImpl (const TBitArray &InOther, TBitArray &OutResult, EBitwiseOperatorFlags InFlags, ProjectionType &&InProjection) |
Private Attributes | |
AllocatorType | AllocatorInstance |
int32 | NumBits |
int32 | MaxBits |
Static Private Attributes | |
static constexpr WordType | FullWordMask = (WordType)-1 |
Friends | |
template<typename , typename > | |
class | TScriptBitArray |
template<typename > | |
class | TConstSetBitIterator |
template<typename , typename , bool > | |
class | TConstDualSetBitIterator |
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.
Definition at line 240 of file BitArray.h.
Definition at line 250 of file BitArray.h.
Definition at line 245 of file BitArray.h.
|
inline |
Definition at line 258 of file BitArray.h.
|
inlineexplicit |
Minimal initialization constructor.
Value | - The value to initial the bits to. |
InNumBits | - The initial number of bits in the array. |
Definition at line 270 of file BitArray.h.
|
inline |
Move constructor.
Definition at line 279 of file BitArray.h.
|
inline |
Copy constructor.
Definition at line 287 of file BitArray.h.
|
inline |
Definition at line 295 of file BitArray.h.
|
inline |
Definition at line 1272 of file BitArray.h.
|
inline |
Definition at line 1282 of file BitArray.h.
Adds a bit to the array with the given value.
Definition at line 493 of file BitArray.h.
Adds multiple bits to the array with the given value.
Definition at line 504 of file BitArray.h.
|
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. |
Definition at line 525 of file BitArray.h.
|
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. |
Definition at line 540 of file BitArray.h.
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. |
Definition at line 553 of file BitArray.h.
|
inlineprivate |
Definition at line 425 of file BitArray.h.
|
inlinestatic |
Return the bitwise AND of two bit arrays. The resulting bit array will be sized according to InFlags.
Definition at line 1097 of file BitArray.h.
|
inlinestaticprivate |
Definition at line 1428 of file BitArray.h.
Perform a bitwise NOT on all the bits in this array
Definition at line 1156 of file BitArray.h.
|
inlinestaticprivate |
Definition at line 1493 of file BitArray.h.
|
inlinestatic |
Return the bitwise OR of two bit arrays. The resulting bit array will be sized according to InFlags.
Definition at line 1116 of file BitArray.h.
|
inlinestatic |
Return the bitwise XOR of two bit arrays. The resulting bit array will be sized according to InFlags.
Definition at line 1137 of file BitArray.h.
Checks the invariants of this class
Definition at line 443 of file BitArray.h.
Clears the slack bits within the final partially relevant Word
Definition at line 1681 of file BitArray.h.
|
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()).
Definition at line 1107 of file BitArray.h.
|
inline |
Return the bitwise OR of two bit arrays. The resulting bit array will be sized according to InFlags.
Definition at line 1128 of file BitArray.h.
|
inline |
Return the bitwise XOR of two bit arrays. The resulting bit array will be sized according to InFlags.
Definition at line 1147 of file BitArray.h.
|
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 |
Definition at line 1193 of file BitArray.h.
|
inline |
Definition at line 1013 of file BitArray.h.
Tracks the container's memory use through an archive.
Definition at line 933 of file BitArray.h.
|
inline |
Count the number of set bits in this array FromIndex <= bit < ToIndex
Definition at line 1167 of file BitArray.h.
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. |
Definition at line 657 of file BitArray.h.
Finds the first true/false bit in the array, and returns the bit index. If there is none, INDEX_NONE is returned.
Definition at line 945 of file BitArray.h.
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.
Definition at line 1022 of file BitArray.h.
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.
Definition at line 1056 of file BitArray.h.
Finds the last true/false bit in the array, and returns the bit index. If there is none, INDEX_NONE is returned.
Definition at line 978 of file BitArray.h.
Helper function to return the amount of memory allocated by this container
Definition at line 927 of file BitArray.h.
Definition at line 1420 of file BitArray.h.
|
inline |
Definition at line 1415 of file BitArray.h.
|
inlineprivate |
Definition at line 389 of file BitArray.h.
|
inlineprivate |
Definition at line 384 of file BitArray.h.
|
inlineprivate |
Definition at line 379 of file BitArray.h.
|
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. |
Definition at line 854 of file BitArray.h.
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. |
Definition at line 706 of file BitArray.h.
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(). |
Definition at line 581 of file BitArray.h.
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. |
Definition at line 593 of file BitArray.h.
|
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. |
Definition at line 608 of file BitArray.h.
|
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. |
Definition at line 622 of file BitArray.h.
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. |
Definition at line 635 of file BitArray.h.
Returns true if the bit array is empty and contains no elements.
Definition at line 1249 of file BitArray.h.
|
inline |
Definition at line 1238 of file BitArray.h.
Definition at line 1255 of file BitArray.h.
|
inlinestaticprivate |
Definition at line 412 of file BitArray.h.
Definition at line 1254 of file BitArray.h.
|
inline |
Definition at line 372 of file BitArray.h.
|
inline |
Definition at line 348 of file BitArray.h.
|
inline |
Assignment operator.
Definition at line 318 of file BitArray.h.
|
inline |
Definition at line 330 of file BitArray.h.
|
inline |
Move assignment.
Definition at line 305 of file BitArray.h.
|
inline |
Definition at line 338 of file BitArray.h.
|
inline |
Definition at line 1256 of file BitArray.h.
|
inline |
Definition at line 1264 of file BitArray.h.
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) |
Definition at line 1226 of file BitArray.h.
|
inlineprivate |
Definition at line 1662 of file BitArray.h.
Removes bits from the array.
BaseIndex | - The index of the first bit to remove. |
NumBitsToRemove | - The number of consecutive bits to remove. |
Definition at line 869 of file BitArray.h.
Definition at line 892 of file BitArray.h.
Reserves memory such that the array can contain at least Number bits.
@Number The number of bits to reserve space for.
Definition at line 678 of file BitArray.h.
Removes all bits from the array retaining any space already allocated.
Definition at line 695 of file BitArray.h.
Serializer
Definition at line 465 of file BitArray.h.
Definition at line 1671 of file BitArray.h.
Sets number of bits without initializing new bits.
Definition at line 727 of file BitArray.h.
|
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. |
Definition at line 752 of file BitArray.h.
|
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. |
Definition at line 819 of file BitArray.h.
|
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. |
Definition at line 838 of file BitArray.h.
|
inlinestaticprivate |
Definition at line 395 of file BitArray.h.
|
inline |
Definition at line 1716 of file BitArray.h.
|
friend |
Definition at line 256 of file BitArray.h.
Definition at line 253 of file BitArray.h.
Definition at line 243 of file BitArray.h.
|
private |
Definition at line 1658 of file BitArray.h.
Definition at line 246 of file BitArray.h.
Definition at line 1660 of file BitArray.h.
Definition at line 1659 of file BitArray.h.