Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
bitset_detail::MultiIntBitSet< I, N >::Iterator Class Reference

Iterator type returned by begin(), which efficiently iterates all 1 positions. More...

Public Member Functions

 Iterator ()=delete
 Do not allow external code to construct an Iterator. More...
 
constexpr Iterator (const Iterator &) noexcept=default
 
constexpr Iteratoroperator= (const Iterator &) noexcept=default
 
constexpr Iteratoroperator++ () noexcept
 Progress to the next 1 bit (only if != IteratorEnd). More...
 
constexpr unsigned operator* () const noexcept
 Get the current bit position (only if != IteratorEnd). More...
 

Private Member Functions

constexpr Iterator (const std::array< I, N > &ref) noexcept
 

Private Attributes

const std::array< I, N > * m_ptr
 Pointer to array to fetch bits from. More...
 
m_val
 The remaining bits of (*m_ptr)[m_idx]. More...
 
unsigned m_pos
 The last reported position. More...
 
unsigned m_idx
 The index in *m_ptr currently being iterated over. More...
 

Friends

class MultiIntBitSet
 
constexpr bool operator== (const Iterator &a, const IteratorEnd &) noexcept
 Test whether we are done (can only compare with IteratorEnd). More...
 

Detailed Description

template<typename I, unsigned N>
class bitset_detail::MultiIntBitSet< I, N >::Iterator

Iterator type returned by begin(), which efficiently iterates all 1 positions.

Definition at line 251 of file bitset.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<typename I , unsigned N>
constexpr bitset_detail::MultiIntBitSet< I, N >::Iterator::Iterator ( const std::array< I, N > &  ref)
inlineconstexprprivatenoexcept

Definition at line 258 of file bitset.h.

◆ Iterator() [2/3]

template<typename I , unsigned N>
bitset_detail::MultiIntBitSet< I, N >::Iterator::Iterator ( )
delete

Do not allow external code to construct an Iterator.

◆ Iterator() [3/3]

template<typename I , unsigned N>
constexpr bitset_detail::MultiIntBitSet< I, N >::Iterator::Iterator ( const Iterator )
constexprdefaultnoexcept

Member Function Documentation

◆ operator*()

template<typename I , unsigned N>
constexpr unsigned bitset_detail::MultiIntBitSet< I, N >::Iterator::operator* ( ) const
inlineconstexprnoexcept

Get the current bit position (only if != IteratorEnd).

Definition at line 302 of file bitset.h.

◆ operator++()

template<typename I , unsigned N>
constexpr Iterator & bitset_detail::MultiIntBitSet< I, N >::Iterator::operator++ ( )
inlineconstexprnoexcept

Progress to the next 1 bit (only if != IteratorEnd).

Definition at line 282 of file bitset.h.

◆ operator=()

template<typename I , unsigned N>
constexpr Iterator & bitset_detail::MultiIntBitSet< I, N >::Iterator::operator= ( const Iterator )
constexprdefaultnoexcept

Friends And Related Function Documentation

◆ MultiIntBitSet

template<typename I , unsigned N>
friend class MultiIntBitSet
friend

Definition at line 253 of file bitset.h.

◆ operator==

template<typename I , unsigned N>
constexpr bool operator== ( const Iterator a,
const IteratorEnd  
)
friend

Test whether we are done (can only compare with IteratorEnd).

Definition at line 277 of file bitset.h.

Member Data Documentation

◆ m_idx

template<typename I , unsigned N>
unsigned bitset_detail::MultiIntBitSet< I, N >::Iterator::m_idx
private

The index in *m_ptr currently being iterated over.

Definition at line 257 of file bitset.h.

◆ m_pos

template<typename I , unsigned N>
unsigned bitset_detail::MultiIntBitSet< I, N >::Iterator::m_pos
private

The last reported position.

Definition at line 256 of file bitset.h.

◆ m_ptr

template<typename I , unsigned N>
const std::array<I, N>* bitset_detail::MultiIntBitSet< I, N >::Iterator::m_ptr
private

Pointer to array to fetch bits from.

Definition at line 254 of file bitset.h.

◆ m_val

template<typename I , unsigned N>
I bitset_detail::MultiIntBitSet< I, N >::Iterator::m_val
private

The remaining bits of (*m_ptr)[m_idx].

Definition at line 255 of file bitset.h.


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