CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
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:
Collaboration graph
[legend]

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_iteratoroperator++ ()
 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 BitVectorbitVector = nullptr
 
size_t position = 0
 

Detailed Description

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

Definition at line 105 of file Values.h.

Member Typedef Documentation

◆ difference_type

Definition at line 107 of file Values.h.

◆ iterator_category

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

Definition at line 111 of file Values.h.

◆ pointer

Definition at line 109 of file Values.h.

◆ reference

Definition at line 110 of file Values.h.

◆ value_type

Definition at line 108 of file Values.h.

Constructor & Destructor Documentation

◆ bit_iterator() [1/2]

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

Default constructor.

◆ 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 117 of file Values.h.

Member Function Documentation

◆ operator!=() [1/2]

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

Inequality comparison.

Definition at line 146 of file Values.h.

◆ operator!=() [2/2]

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

Sentinel-compatible inequality.

Definition at line 161 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 121 of file Values.h.

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

◆ operator++() [1/2]

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

Pre-increment: move to next bit.

Definition at line 128 of file Values.h.

References position.

◆ operator++() [2/2]

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

Post-increment: move to next bit.

Definition at line 134 of file Values.h.

References position.

◆ operator<()

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

Less-than comparison (for ranges support).

Definition at line 151 of file Values.h.

References bitVector, and position.

◆ operator==() [1/2]

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

Equality comparison.

Definition at line 141 of file Values.h.

References 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 156 of file Values.h.

References bitVector, esi::BitVector::bitWidth, and position.

Member Data Documentation

◆ bitVector

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

Definition at line 166 of file Values.h.

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

◆ position

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

Definition at line 167 of file Values.h.

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


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