|
Blender V4.3
|
#include <BLI_bit_ref.hh>
Public Member Functions | |
| MutableBitRef ()=default | |
| MutableBitRef (BitInt *data, const int64_t bit_index) | |
| operator BitRef () const | |
| bool | test () const |
| operator bool () const | |
| void | set () |
| void | reset () |
| void | set (const bool value) |
| void | set_branchless (const bool value) |
| MutableBitRef & | operator|= (const bool value) |
| MutableBitRef & | operator&= (const bool value) |
Similar to #BitRef, but also allows changing the referenced bit.
Definition at line 126 of file BLI_bit_ref.hh.
|
default |
Reference a specific bit in an array. Note that #data does not have to point to the exact int the bit is in.
Definition at line 140 of file BLI_bit_ref.hh.
References blender::bits::BitIndexMask, blender::bits::int_containing_bit(), and blender::bits::mask_single_bit().
|
inline |
Support implicitly casting to a read-only #BitRef.
Definition at line 149 of file BLI_bit_ref.hh.
|
inline |
Definition at line 167 of file BLI_bit_ref.hh.
References test().
|
inline |
Definition at line 228 of file BLI_bit_ref.hh.
References reset().
|
inline |
Definition at line 220 of file BLI_bit_ref.hh.
References set().
|
inline |
Change the bit to a 0.
Definition at line 183 of file BLI_bit_ref.hh.
Referenced by operator&=(), set(), and blender::bits::tests::TEST().
|
inline |
Change the bit to a 1.
Definition at line 175 of file BLI_bit_ref.hh.
Referenced by blender::bits::BitVector< InlineBufferCapacity, Allocator >::append(), operator|=(), set(), blender::bits::tests::TEST(), and blender::bits::tests::TEST().
|
inline |
Change the bit to a 1 if #value is true and 0 otherwise. If the value is highly unpredictable by the CPU branch predictor, it can be faster to use set_branchless instead.
Definition at line 192 of file BLI_bit_ref.hh.
|
inline |
Does the same as set, but does not use a branch. This is faster when the input value is unpredictable for the CPU branch predictor (best case for this function is a uniform random distribution with 50% probability for true and false). If the value is predictable, this is likely slower than set.
Definition at line 208 of file BLI_bit_ref.hh.
References BLI_assert, and ELEM.
Referenced by blender::bits::tests::TEST().
|
inline |
Return true when the bit is currently 1 and false otherwise.
Definition at line 160 of file BLI_bit_ref.hh.
Referenced by operator bool().