Blender V5.3
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 ()
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
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 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

◆ 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

Definition at line 99 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 117 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 122 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 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.

◆ 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.

◆ 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()

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 303 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 246 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 211 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 185 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 190 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 180 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 175 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 239 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 229 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 312 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 286 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 198 of file BLI_bit_vector.hh.


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