CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::BitVector::bit_iterator Class Reference

Forward iterator for iterating over bits from LSB (index 0) to MSB. More...

#include <Values.h>

Collaboration diagram for esi::BitVector::bit_iterator:

Public Types

using difference_type = std::ptrdiff_t
using value_type = bool
using pointer = const bool *
using reference = bool
using iterator_category = std::forward_iterator_tag

Public Member Functions

 bit_iterator ()=default
 Default constructor.
 bit_iterator (const BitVector *bv, size_t pos=0)
 Construct an iterator at the given bit position.
bool operator* () const
 Dereference: returns the bit value at the current position.
bit_iterator & operator++ ()
 Pre-increment: move to next bit.
bit_iterator operator++ (int)
 Post-increment: move to next bit.
bool operator== (const bit_iterator &other) const
 Equality comparison.
bool operator!= (const bit_iterator &other) const
 Inequality comparison.
bool operator< (const bit_iterator &other) const
 Less-than comparison (for ranges support).
bool operator== (std::default_sentinel_t) const
 Sentinel-compatible equality (for ranges support).
bool operator!= (std::default_sentinel_t sent) const
 Sentinel-compatible inequality.

Private Attributes

const BitVector * bitVector = nullptr
size_t position = 0

Detailed Description

Forward iterator for iterating over bits from LSB (index 0) to MSB.

Definition at line 114 of file Values.h.

Member Typedef Documentation

◆ difference_type

Definition at line 116 of file Values.h.

◆ iterator_category

using esi::BitVector::bit_iterator::iterator_category = std::forward_iterator_tag

Definition at line 120 of file Values.h.

◆ pointer

Definition at line 118 of file Values.h.

◆ reference

Definition at line 119 of file Values.h.

◆ value_type

Definition at line 117 of file Values.h.

Constructor & Destructor Documentation

◆ bit_iterator() [1/2]

esi::BitVector::bit_iterator::bit_iterator ( )
default

Default constructor.

Referenced by operator!=(), operator++(), operator++(), operator<(), and operator==().

◆ bit_iterator() [2/2]

esi::BitVector::bit_iterator::bit_iterator ( const BitVector * bv,
size_t pos = 0 )
inline

Construct an iterator at the given bit position.

Definition at line 126 of file Values.h.

References esi::BitVector::BitVector(), bitVector, and position.

Member Function Documentation

◆ operator!=() [1/2]

bool esi::BitVector::bit_iterator::operator!= ( const bit_iterator & other) const
inline

Inequality comparison.

Definition at line 155 of file Values.h.

References bit_iterator().

◆ operator!=() [2/2]

bool esi::BitVector::bit_iterator::operator!= ( std::default_sentinel_t sent) const
inline

Sentinel-compatible inequality.

Definition at line 170 of file Values.h.

◆ operator*()

bool esi::BitVector::bit_iterator::operator* ( ) const
inline

Dereference: returns the bit value at the current position.

Definition at line 130 of file Values.h.

References bitVector, and position.

◆ operator++() [1/2]

bit_iterator & esi::BitVector::bit_iterator::operator++ ( )
inline

Pre-increment: move to next bit.

Definition at line 137 of file Values.h.

References bit_iterator(), and position.

◆ operator++() [2/2]

bit_iterator esi::BitVector::bit_iterator::operator++ ( int )
inline

Post-increment: move to next bit.

Definition at line 143 of file Values.h.

References bit_iterator(), and position.

◆ operator<()

bool esi::BitVector::bit_iterator::operator< ( const bit_iterator & other) const
inline

Less-than comparison (for ranges support).

Definition at line 160 of file Values.h.

References bit_iterator(), bitVector, and position.

◆ operator==() [1/2]

bool esi::BitVector::bit_iterator::operator== ( const bit_iterator & other) const
inline

Equality comparison.

Definition at line 150 of file Values.h.

References bit_iterator(), bitVector, and position.

◆ operator==() [2/2]

bool esi::BitVector::bit_iterator::operator== ( std::default_sentinel_t ) const
inline

Sentinel-compatible equality (for ranges support).

Definition at line 165 of file Values.h.

References bitVector, and position.

Member Data Documentation

◆ bitVector

const BitVector* esi::BitVector::bit_iterator::bitVector = nullptr
private

Definition at line 175 of file Values.h.

Referenced by bit_iterator(), operator*(), operator<(), operator==(), and operator==().

◆ position

size_t esi::BitVector::bit_iterator::position = 0
private

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