File view_vector_bit.hpp¶
Typedefs
-
using AllocatedBitVector = BitVectorAllocator<BitView>¶
Allocates the memory, a
BitViewprovides access to.
-
class BitView : public Vector<uint32>¶
- #include <view_vector_bit.hpp>
A one-dimensional view that provides access to binary values stored in a pre-allocated array in a space-efficient way (see https://en.wikipedia.org/wiki/Bit_array).
Public Types
-
using bit_const_iterator = ConstIterator¶
An iterator that provides read-only access to the binary values in the vector.
Public Functions
-
inline BitView(uint32 *array, uint32 numBits)¶
- Parameters:
array – A pointer to an array of type
uint32that stores the values, the view should provide access tonumBits – The number of bits in the view
-
inline BitView(const BitView &other)¶
- Parameters:
other – A const reference to an object of type
BitViewthat should be copied
-
inline BitView(BitView &&other)¶
- Parameters:
other – A reference to an object of type
BitViewthat should be moved
-
inline virtual ~BitView() override¶
-
inline bit_const_iterator bits_cbegin() const¶
Returns a
bit_const_iteratorto the beginning of the binary values in the vector.- Returns:
A
bit_const_iteratorto the beginning
-
inline bit_const_iterator bits_cend() const¶
Returns a
bit_const_iteratorto the end of the binary values in the vector.- Returns:
A
bit_const_iteratorto the end
Public Static Attributes
Private Static Functions
-
class ConstIterator¶
- #include <view_vector_bit.hpp>
An iterator that provides random read-only access to the binary values in a
BitView.Public Types
-
using difference_type = int¶
The type that is used to represent the difference between two iterators.
-
using value_type = const bool¶
The type of the elements, the iterator provides access to.
-
using pointer = const bool*¶
The type of a pointer to an element, the iterator provides access to.
-
using reference = const bool&¶
The type of a reference to an element, the iterator provides access to.
-
using iterator_category = std::random_access_iterator_tag¶
The tag that specifies the capabilities of the iterator.
Public Functions
-
inline ConstIterator(const BitView &view, uint32 startIndex = 0)¶
- Parameters:
view – A reference to an object of type
BitView, the iterator should provide access tostartIndex – The index to start at
-
inline value_type operator[](uint32 index) const¶
Returns whether the bit at a specific index is set or unset.
- Parameters:
index – The index of the element to be returned
- Returns:
True if the bit at the given index is set, false, if it is unset
-
inline value_type operator*()¶
Returns the element, the iterator currently refers to.
- Returns:
The element, the iterator currently refers to
-
inline ConstIterator &operator++()¶
Returns an iterator to the next element.
- Returns:
A reference to an iterator that refers to the next element
-
inline ConstIterator &operator++(int n)¶
Returns an iterator to the next element.
- Returns:
A reference to an iterator that refers to the next element
-
inline ConstIterator &operator--()¶
Returns an iterator to the previous element.
- Returns:
A reference to an iterator that refers to the previous element
-
inline ConstIterator &operator--(int n)¶
Returns an iterator to the previous element.
- Returns:
A reference to an iterator that refers to the previous element
-
inline bool operator!=(const ConstIterator &rhs) const¶
Returns whether this iterator and another one refer to the same element.
- Parameters:
rhs – A reference to another iterator
- Returns:
True, if the iterators do not refer to the same element, false otherwise
-
inline bool operator==(const ConstIterator &rhs) const¶
Returns whether this iterator and another one refer to the same element.
- Parameters:
rhs – A reference to another iterator
- Returns:
True, if the iterators refer to the same element, false otherwise
-
inline difference_type operator-(const ConstIterator &rhs) const¶
Returns the difference between this iterator and another one.
- Parameters:
rhs – A reference to another iterator
- Returns:
The difference between the iterators
-
using difference_type = int¶
-
using bit_const_iterator = ConstIterator¶
-
template<typename View>
class BitVectorAllocator : public Allocator<View>¶ - #include <view_vector_bit.hpp>
Allocates the memory, a
BitViewprovides access to.- Template Parameters:
View – The type of the view
Public Functions
-
inline explicit BitVectorAllocator(uint32 numBits, bool init = false)¶
- Parameters:
numBits – The number of bits in the vector
init – True, if all elements in the view should be value-initialized, false otherwise
-
inline BitVectorAllocator(const BitVectorAllocator<View> &other)¶
- Parameters:
other – A reference to an object of type
BitVectorAllocatorthat should be copied
-
inline BitVectorAllocator(BitVectorAllocator<View> &&other)¶
- Parameters:
other – A reference to an object of type
BitVectorAllocatorthat should be moved
-
inline virtual ~BitVectorAllocator() override¶
-
template<typename View>
class BitVectorDecorator : public ViewDecorator<View>¶ - #include <view_vector_bit.hpp>
A vector that stores binary values in a
BitView.- Template Parameters:
View – The type of the
BitView, the vector is backed by
-
template<typename BitVector>
class IndexableBitVectorDecorator : public BitVector¶ - #include <view_vector_bit.hpp>
Provides random read and write access to values stored in a bit vector.
- Template Parameters:
View – The type of view, the vector is backed by
Public Functions
-
inline explicit IndexableBitVectorDecorator(typename BitVector::view_type &&view)¶
- Parameters:
view – The view, the vector should be backed by
-
inline virtual ~IndexableBitVectorDecorator() override¶