sparrow 0.3.0
Loading...
Searching...
No Matches
sparrow::dynamic_bitset_base< B > Class Template Reference

Base class for dynamic_bitset and dynamic_bitset_view. More...

#include <dynamic_bitset_base.hpp>

Public Types

using self_type = dynamic_bitset_base<B>
 
using storage_type = B
 
using storage_type_without_cvrefpointer = std::remove_pointer_t<std::remove_cvref_t<storage_type>>
 
using block_type = typename storage_type_without_cvrefpointer::value_type
 
using value_type = bool
 
using reference = bitset_reference<self_type>
 
using const_reference = bool
 
using size_type = typename storage_type_without_cvrefpointer::size_type
 
using difference_type = typename storage_type_without_cvrefpointer::difference_type
 
using iterator = bitset_iterator<self_type, false>
 
using const_iterator = bitset_iterator<self_type, true>
 

Public Member Functions

constexpr size_type size () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr size_type null_count () const noexcept
 
constexpr bool test (size_type pos) const
 
constexpr void set (size_type pos, value_type value)
 
constexpr const_reference at (size_type pos) const
 
constexpr reference at (size_type pos)
 
constexpr reference operator[] (size_type i)
 
constexpr const_reference operator[] (size_type i) const
 
constexpr block_typedata () noexcept
 
constexpr const block_typedata () const noexcept
 
constexpr size_type block_count () const noexcept
 
constexpr void swap (self_type &) noexcept
 
constexpr iterator begin ()
 
constexpr iterator end ()
 
constexpr const_iterator begin () const
 
constexpr const_iterator end () const
 
constexpr const_iterator cbegin () const
 
constexpr const_iterator cend () const
 
constexpr reference front ()
 
constexpr const_reference front () const
 
constexpr reference back ()
 
constexpr const_reference back () const
 
constexpr const storage_type_without_cvrefpointerbuffer () const noexcept
 
constexpr storage_type_without_cvrefpointerbuffer () noexcept
 
storage_type extract_storage () noexcept
 

Static Public Member Functions

static constexpr size_type compute_block_count (size_type bits_count) noexcept
 

Protected Member Functions

constexpr dynamic_bitset_base (storage_type buffer, size_type size)
 
constexpr dynamic_bitset_base (storage_type buffer, size_type size, size_type null_count)
 
constexpr ~dynamic_bitset_base ()=default
 
constexpr dynamic_bitset_base (const dynamic_bitset_base &)=default
 
constexpr dynamic_bitset_base (dynamic_bitset_base &&) noexcept=default
 
constexpr dynamic_bitset_baseoperator= (const dynamic_bitset_base &)=default
 
constexpr dynamic_bitset_baseoperator= (dynamic_bitset_base &&) noexcept=default
 
constexpr void resize (size_type n, value_type b=false)
 
constexpr void clear () noexcept
 
constexpr iterator insert (const_iterator pos, value_type value)
 
constexpr iterator insert (const_iterator pos, size_type count, value_type value)
 
template<std::input_iterator InputIt>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
constexpr iterator insert (const_iterator pos, InputIt first, InputIt last)
 
constexpr iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 
constexpr iterator emplace (const_iterator pos, value_type value)
 
constexpr iterator erase (const_iterator pos)
 
constexpr iterator erase (const_iterator first, const_iterator last)
 
constexpr void push_back (value_type value)
 
constexpr void pop_back ()
 

Friends

class bitset_iterator< self_type, true >
 
class bitset_iterator< self_type, false >
 
class bitset_reference< self_type >
 

Detailed Description

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
class sparrow::dynamic_bitset_base< B >

Base class for dynamic_bitset and dynamic_bitset_view.

Both represent a dynamic size sequence of bits. The only difference between dynamic_bitset and dynamic_bitset_view is that the former holds and manages its memory while the second does not.

Template Parameters
Bthe underlying storage

Definition at line 42 of file dynamic_bitset_base.hpp.

Member Typedef Documentation

◆ block_type

template<typename B>
using sparrow::dynamic_bitset_base< B >::block_type = typename storage_type_without_cvrefpointer::value_type

Definition at line 49 of file dynamic_bitset_base.hpp.

◆ const_iterator

template<typename B>
using sparrow::dynamic_bitset_base< B >::const_iterator = bitset_iterator<self_type, true>

Definition at line 56 of file dynamic_bitset_base.hpp.

◆ const_reference

template<typename B>
using sparrow::dynamic_bitset_base< B >::const_reference = bool

Definition at line 52 of file dynamic_bitset_base.hpp.

◆ difference_type

template<typename B>
using sparrow::dynamic_bitset_base< B >::difference_type = typename storage_type_without_cvrefpointer::difference_type

Definition at line 54 of file dynamic_bitset_base.hpp.

◆ iterator

template<typename B>
using sparrow::dynamic_bitset_base< B >::iterator = bitset_iterator<self_type, false>

Definition at line 55 of file dynamic_bitset_base.hpp.

◆ reference

template<typename B>
using sparrow::dynamic_bitset_base< B >::reference = bitset_reference<self_type>

Definition at line 51 of file dynamic_bitset_base.hpp.

◆ self_type

template<typename B>
using sparrow::dynamic_bitset_base< B >::self_type = dynamic_bitset_base<B>

Definition at line 46 of file dynamic_bitset_base.hpp.

◆ size_type

template<typename B>
using sparrow::dynamic_bitset_base< B >::size_type = typename storage_type_without_cvrefpointer::size_type

Definition at line 53 of file dynamic_bitset_base.hpp.

◆ storage_type

template<typename B>
using sparrow::dynamic_bitset_base< B >::storage_type = B

Definition at line 47 of file dynamic_bitset_base.hpp.

◆ storage_type_without_cvrefpointer

template<typename B>
using sparrow::dynamic_bitset_base< B >::storage_type_without_cvrefpointer = std::remove_pointer_t<std::remove_cvref_t<storage_type>>

Definition at line 48 of file dynamic_bitset_base.hpp.

◆ value_type

template<typename B>
using sparrow::dynamic_bitset_base< B >::value_type = bool

Definition at line 50 of file dynamic_bitset_base.hpp.

Constructor & Destructor Documentation

◆ dynamic_bitset_base() [1/4]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
sparrow::dynamic_bitset_base< B >::dynamic_bitset_base ( storage_type buffer,
size_type size )
constexprprotected

Definition at line 384 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dynamic_bitset_base() [2/4]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
sparrow::dynamic_bitset_base< B >::dynamic_bitset_base ( storage_type buffer,
size_type size,
size_type null_count )
constexprprotected

Definition at line 397 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ ~dynamic_bitset_base()

template<typename B>
sparrow::dynamic_bitset_base< B >::~dynamic_bitset_base ( )
constexprprotecteddefault

◆ dynamic_bitset_base() [3/4]

template<typename B>
sparrow::dynamic_bitset_base< B >::dynamic_bitset_base ( const dynamic_bitset_base< B > & )
constexprprotecteddefault

◆ dynamic_bitset_base() [4/4]

template<typename B>
sparrow::dynamic_bitset_base< B >::dynamic_bitset_base ( dynamic_bitset_base< B > && )
constexprprotecteddefaultnoexcept

Member Function Documentation

◆ at() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::at ( size_type pos)
nodiscardconstexpr

Definition at line 316 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ at() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::at ( size_type pos) const
nodiscardconstexpr

Definition at line 330 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ back() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::back ( )
nodiscardconstexpr

Definition at line 364 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ back() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::back ( ) const
nodiscardconstexpr

Definition at line 372 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ begin() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::begin ( )
nodiscardconstexpr

Definition at line 272 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ begin() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::begin ( ) const
nodiscardconstexpr

Definition at line 287 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ block_count()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::block_count ( ) const
nodiscardconstexprnoexcept

Definition at line 255 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ buffer() [1/2]

template<typename B>
const storage_type_without_cvrefpointer & sparrow::dynamic_bitset_base< B >::buffer ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 90 of file dynamic_bitset_base.hpp.

Here is the caller graph for this function:

◆ buffer() [2/2]

template<typename B>
storage_type_without_cvrefpointer & sparrow::dynamic_bitset_base< B >::buffer ( )
inlinenodiscardconstexprnoexcept

Definition at line 102 of file dynamic_bitset_base.hpp.

◆ cbegin()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::cbegin ( ) const
nodiscardconstexpr

Definition at line 301 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cend()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::cend ( ) const
nodiscardconstexpr

Definition at line 308 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
void sparrow::dynamic_bitset_base< B >::clear ( )
constexprprotectednoexcept

Definition at line 533 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ compute_block_count()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::compute_block_count ( size_type bits_count)
staticnodiscardconstexprnoexcept

Definition at line 411 of file dynamic_bitset_base.hpp.

Here is the caller graph for this function:

◆ data() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::data ( ) const
nodiscardconstexprnoexcept

Definition at line 248 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ data() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::data ( )
nodiscardconstexprnoexcept

Definition at line 241 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
dynamic_bitset_base< B >::iterator sparrow::dynamic_bitset_base< B >::emplace ( const_iterator pos,
value_type value )
constexprprotected

Definition at line 613 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ empty()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
bool sparrow::dynamic_bitset_base< B >::empty ( ) const
nodiscardconstexprnoexcept

Definition at line 180 of file dynamic_bitset_base.hpp.

◆ end() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::end ( )
nodiscardconstexpr

Definition at line 279 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::end ( ) const
nodiscardconstexpr

Definition at line 294 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ erase() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
dynamic_bitset_base< B >::iterator sparrow::dynamic_bitset_base< B >::erase ( const_iterator first,
const_iterator last )
constexprprotected

Definition at line 631 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ erase() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
dynamic_bitset_base< B >::iterator sparrow::dynamic_bitset_base< B >::erase ( const_iterator pos)
constexprprotected

Definition at line 620 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extract_storage()

template<typename B>
storage_type sparrow::dynamic_bitset_base< B >::extract_storage ( )
inlinenodiscardnoexcept

Definition at line 117 of file dynamic_bitset_base.hpp.

◆ front() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::front ( )
nodiscardconstexpr

Definition at line 344 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ front() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::front ( ) const
nodiscardconstexpr

Definition at line 352 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ insert() [1/4]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
template<std::input_iterator InputIt>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
dynamic_bitset_base< B >::iterator sparrow::dynamic_bitset_base< B >::insert ( const_iterator pos,
InputIt first,
InputIt last )
constexprprotected

Definition at line 582 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ insert() [2/4]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
dynamic_bitset_base< B >::iterator sparrow::dynamic_bitset_base< B >::insert ( const_iterator pos,
size_type count,
value_type value )
constexprprotected

Definition at line 551 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ insert() [3/4]

template<typename B>
iterator sparrow::dynamic_bitset_base< B >::insert ( const_iterator pos,
std::initializer_list< value_type > ilist )
constexprprotected

◆ insert() [4/4]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
dynamic_bitset_base< B >::iterator sparrow::dynamic_bitset_base< B >::insert ( const_iterator pos,
value_type value )
constexprprotected

Definition at line 543 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ null_count()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::null_count ( ) const
nodiscardconstexprnoexcept

Definition at line 187 of file dynamic_bitset_base.hpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename B>
dynamic_bitset_base & sparrow::dynamic_bitset_base< B >::operator= ( const dynamic_bitset_base< B > & )
constexprprotecteddefault

◆ operator=() [2/2]

template<typename B>
dynamic_bitset_base & sparrow::dynamic_bitset_base< B >::operator= ( dynamic_bitset_base< B > && )
constexprprotecteddefaultnoexcept

◆ operator[]() [1/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::operator[] ( size_type i)
nodiscardconstexpr

Definition at line 194 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ operator[]() [2/2]

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
bool sparrow::dynamic_bitset_base< B >::operator[] ( size_type i) const
nodiscardconstexpr

Definition at line 203 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ pop_back()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
void sparrow::dynamic_bitset_base< B >::pop_back ( )
constexprprotected

Definition at line 672 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ push_back()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
void sparrow::dynamic_bitset_base< B >::push_back ( value_type value)
constexprprotected

Definition at line 665 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:

◆ resize()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
void sparrow::dynamic_bitset_base< B >::resize ( size_type n,
value_type b = false )
constexprprotected

Definition at line 506 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
void sparrow::dynamic_bitset_base< B >::set ( size_type pos,
value_type value )
constexpr

Definition at line 222 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
auto sparrow::dynamic_bitset_base< B >::size ( ) const
nodiscardconstexprnoexcept

Definition at line 173 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
void sparrow::dynamic_bitset_base< B >::swap ( self_type & rhs)
constexprnoexcept

Definition at line 262 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test()

template<typename B>
requires std::ranges::random_access_range<std::remove_pointer_t<B>>
bool sparrow::dynamic_bitset_base< B >::test ( size_type pos) const
nodiscardconstexpr

Definition at line 210 of file dynamic_bitset_base.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ bitset_iterator< self_type, false >

template<typename B>
friend class bitset_iterator< self_type, false >
friend

Definition at line 164 of file dynamic_bitset_base.hpp.

◆ bitset_iterator< self_type, true >

template<typename B>
friend class bitset_iterator< self_type, true >
friend

Definition at line 164 of file dynamic_bitset_base.hpp.

◆ bitset_reference< self_type >

template<typename B>
friend class bitset_reference< self_type >
friend

Definition at line 164 of file dynamic_bitset_base.hpp.


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