Blender V5.3
blender::bits::BitVector< InlineBufferCapacity, Allocator > Class Template Reference

#include <BLI_bit_vector.hh>

Public Member Functions

 BitVector (Allocator allocator={}) noexcept
 BitVector (NoExceptConstructor, Allocator allocator={}) noexcept
 BitVector (const BoundedBitSpan span)
 BitVector (const BitVector &other)
 BitVector (BitVector &&other) noexcept
 BitVector (const int64_t size_in_bits, const bool value=false, Allocator allocator={})
 BitVector (const Span< bool > values, Allocator allocator={})
 ~BitVector ()
BitVector & operator= (const BitVector &other)
BitVector & operator= (BitVector &&other)
 operator BoundedBitSpan () const
 operator MutableBoundedBitSpan ()
int64_t size () const
int64_t capacity () const
bool is_empty () const
BitInt * data ()
const BitInt * data () const
BitRef operator[] (const int64_t index) const
MutableBitRef operator[] (const int64_t index)
IndexRange index_range () const
void append (const bool value)
BitIterator begin () const
BitIterator end () const
MutableBitIterator begin ()
MutableBitIterator end ()
void resize (const int64_t new_size_in_bits, const bool value=false)
void fill (const bool value)
void reserve (const int new_capacity_in_bits)
void clear ()
void clear_and_shrink ()

Detailed Description

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
class blender::bits::BitVector< InlineBufferCapacity, Allocator >
Template Parameters
InlineBufferCapacityNumber of bits that can be stored in the vector without doing an allocation.
AllocatorThe allocator used by this vector. Should rarely be changed, except when you don't want that MEM_* is used internally.

Definition at line 59 of file BLI_bit_vector.hh.

Constructor & Destructor Documentation

◆ BitVector() [1/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( Allocator allocator = {})
inlinenoexcept

Definition at line 89 of file BLI_bit_vector.hh.

Referenced by BitVector(), BitVector(), BitVector(), operator=(), and operator=().

◆ BitVector() [2/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( NoExceptConstructor ,
Allocator allocator = {} )
inlinenoexcept

Definition at line 97 of file BLI_bit_vector.hh.

◆ BitVector() [3/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( const BoundedBitSpan span)
inline

◆ BitVector() [4/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( const BitVector< InlineBufferCapacity, Allocator > & other)
inline

Definition at line 117 of file BLI_bit_vector.hh.

References BitVector().

◆ BitVector() [5/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( BitVector< InlineBufferCapacity, Allocator > && other)
inlinenoexcept

Definition at line 122 of file BLI_bit_vector.hh.

References BitVector(), and blender::uninitialized_copy_n().

◆ BitVector() [6/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( const int64_t size_in_bits,
const bool value = false,
Allocator allocator = {} )
inline

Create a new vector with the given size and fill it with #value.

Definition at line 152 of file BLI_bit_vector.hh.

◆ BitVector() [7/7]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::BitVector ( const Span< bool > values,
Allocator allocator = {} )
inlineexplicit

Create a bit vector based on an array of bools. Each byte of the input array maps to one bit.

Definition at line 161 of file BLI_bit_vector.hh.

◆ ~BitVector()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::~BitVector ( )
inline

Definition at line 168 of file BLI_bit_vector.hh.

Member Function Documentation

◆ append()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
void blender::bits::BitVector< InlineBufferCapacity, Allocator >::append ( const bool value)
inline

Add a new bit to the end of the vector.

Definition at line 254 of file BLI_bit_vector.hh.

References blender::bits::MutableBitRef::set().

Referenced by blender::bits::tests::TEST(), and blender::bits::tests::TEST().

◆ begin() [1/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
MutableBitIterator blender::bits::BitVector< InlineBufferCapacity, Allocator >::begin ( )
inline

Definition at line 272 of file BLI_bit_vector.hh.

◆ begin() [2/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
BitIterator blender::bits::BitVector< InlineBufferCapacity, Allocator >::begin ( ) const
inline

Definition at line 262 of file BLI_bit_vector.hh.

◆ capacity()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
int64_t blender::bits::BitVector< InlineBufferCapacity, Allocator >::capacity ( ) const
inline

Number of bits that can be stored before the BitVector has to grow.

Definition at line 206 of file BLI_bit_vector.hh.

◆ clear()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
void blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear ( )
inline

Reset the size of the vector to zero elements, but keep the same memory capacity to be refilled again.

Definition at line 321 of file BLI_bit_vector.hh.

◆ clear_and_shrink()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
void blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear_and_shrink ( )
inline

Free memory and reset the vector to zero elements.

Definition at line 329 of file BLI_bit_vector.hh.

◆ data() [1/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
BitInt * blender::bits::BitVector< InlineBufferCapacity, Allocator >::data ( )
inline

Definition at line 216 of file BLI_bit_vector.hh.

Referenced by blender::UniqueName_Value::get_smallest_unused().

◆ data() [2/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
const BitInt * blender::bits::BitVector< InlineBufferCapacity, Allocator >::data ( ) const
inline

Definition at line 221 of file BLI_bit_vector.hh.

◆ end() [1/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
MutableBitIterator blender::bits::BitVector< InlineBufferCapacity, Allocator >::end ( )
inline

Definition at line 277 of file BLI_bit_vector.hh.

◆ end() [2/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
BitIterator blender::bits::BitVector< InlineBufferCapacity, Allocator >::end ( ) const
inline

Definition at line 267 of file BLI_bit_vector.hh.

◆ fill()

◆ index_range()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
IndexRange blender::bits::BitVector< InlineBufferCapacity, Allocator >::index_range ( ) const
inline

◆ is_empty()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
bool blender::bits::BitVector< InlineBufferCapacity, Allocator >::is_empty ( ) const
inline

◆ operator BoundedBitSpan()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::operator BoundedBitSpan ( ) const
inline

Definition at line 185 of file BLI_bit_vector.hh.

References blender::IndexRange::IndexRange().

◆ operator MutableBoundedBitSpan()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
blender::bits::BitVector< InlineBufferCapacity, Allocator >::operator MutableBoundedBitSpan ( )
inline

Definition at line 190 of file BLI_bit_vector.hh.

References blender::IndexRange::IndexRange().

◆ operator=() [1/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
BitVector & blender::bits::BitVector< InlineBufferCapacity, Allocator >::operator= ( BitVector< InlineBufferCapacity, Allocator > && other)
inline

Definition at line 180 of file BLI_bit_vector.hh.

References BitVector(), and blender::move_assign_container().

◆ operator=() [2/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
BitVector & blender::bits::BitVector< InlineBufferCapacity, Allocator >::operator= ( const BitVector< InlineBufferCapacity, Allocator > & other)
inline

Definition at line 175 of file BLI_bit_vector.hh.

References BitVector(), and blender::copy_assign_container().

◆ operator[]() [1/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
MutableBitRef blender::bits::BitVector< InlineBufferCapacity, Allocator >::operator[] ( const int64_t index)
inlinenodiscard

Get a mutable reference to a specific bit.

Definition at line 239 of file BLI_bit_vector.hh.

References blender::BLI_assert().

◆ operator[]() [2/2]

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
BitRef blender::bits::BitVector< InlineBufferCapacity, Allocator >::operator[] ( const int64_t index) const
inlinenodiscard

Get a read-only reference to a specific bit.

Definition at line 229 of file BLI_bit_vector.hh.

References blender::BLI_assert().

◆ reserve()

template<int64_t InlineBufferCapacity = 64, typename Allocator = GuardedAllocator>
void blender::bits::BitVector< InlineBufferCapacity, Allocator >::reserve ( const int new_capacity_in_bits)
inline

Make sure that the capacity of the vector is large enough to hold the given amount of bits. The actual size is not changed.

Definition at line 312 of file BLI_bit_vector.hh.

Referenced by resize().

◆ resize()

◆ size()


The documentation for this class was generated from the following file: