Blender V5.0
blender::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 ()
BitVectoroperator= (const BitVector &other)
BitVectoroperator= (BitVector &&other)
 operator BoundedBitSpan () const
 operator MutableBoundedBitSpan ()
int64_t size () const
int64_t capacity () const
bool is_empty () const
BitIntdata ()
const BitIntdata () 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
MutableBitIterator begin ()
BitIterator end () const
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::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 57 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 87 of file BLI_bit_vector.hh.

◆ BitVector() [2/7]

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

Definition at line 95 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

Definition at line 97 of file BLI_bit_vector.hh.

◆ 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 115 of file BLI_bit_vector.hh.

◆ 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 120 of file BLI_bit_vector.hh.

◆ 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 150 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 159 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 166 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 252 of file BLI_bit_vector.hh.

◆ begin() [1/2]

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

Definition at line 270 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 260 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 204 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 319 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 327 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 214 of file BLI_bit_vector.hh.

◆ data() [2/2]

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

Definition at line 219 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 275 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 265 of file BLI_bit_vector.hh.

◆ fill()

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

Set #value on every element.

Definition at line 301 of file BLI_bit_vector.hh.

◆ index_range()

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

Definition at line 244 of file BLI_bit_vector.hh.

◆ is_empty()

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

Definition at line 209 of file BLI_bit_vector.hh.

◆ operator BoundedBitSpan()

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

Definition at line 183 of file BLI_bit_vector.hh.

◆ operator MutableBoundedBitSpan()

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

Definition at line 188 of file BLI_bit_vector.hh.

◆ 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 178 of file BLI_bit_vector.hh.

◆ 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 173 of file BLI_bit_vector.hh.

◆ 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 237 of file BLI_bit_vector.hh.

◆ 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 227 of file BLI_bit_vector.hh.

◆ 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 310 of file BLI_bit_vector.hh.

◆ resize()

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

Change the size of the vector. If the new vector is larger than the old one, the new elements are filled with #value.

Definition at line 284 of file BLI_bit_vector.hh.

◆ size()

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

Number of bits in the bit vector.

Definition at line 196 of file BLI_bit_vector.hh.


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