Click
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Bitvector::Bit Class Reference

A wrapper class that acts like a single bit. More...

#include <bitvector.hh>

Public Member Functions

 Bit (const Bit &)=default
 
 Bit (Bitvector::word_type &w, int bit_offset)
 Construct a bit at offset bit_offset in data word w.
 
 operator bool () const
 Test if this bit is true.
 
Bit & operator= (bool x)
 Set this bit to x.
 
Bit & operator= (const Bit &x)
 
void flip ()
 Flip this bit.
 
Bit & operator&= (bool x)
 Modify this bit by bitwise and with x.
 
Bit & operator|= (bool x)
 Modify this bit by bitwise or with x.
 
Bit & operator^= (bool x)
 Modify this bit by bitwise exclusive or with x.
 
Bit & operator-= (bool x)
 Modify this bit by bitwise subtraction with x.
 

Detailed Description

A wrapper class that acts like a single bit.

Bits are returned by modifiable Bitvectors' operator[]. They act like bools, but Bit operations actually index into individual bits in some shared word.

Constructor & Destructor Documentation

◆ Bit()

Bitvector::Bit::Bit ( Bitvector::word_type &  w,
int  bit_offset 
)
inline

Construct a bit at offset bit_offset in data word w.

Member Function Documentation

◆ operator bool()

Bitvector::Bit::operator bool ( ) const
inline

Test if this bit is true.

◆ operator=() [1/2]

Bitvector::Bit & Bitvector::Bit::operator= ( bool  x)
inline

Set this bit to x.

◆ operator=() [2/2]

Bitvector::Bit & Bitvector::Bit::operator= ( const Bit &  x)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ flip()

void Bitvector::Bit::flip ( )
inline

Flip this bit.

◆ operator&=()

Bitvector::Bit & Bitvector::Bit::operator&= ( bool  x)
inline

Modify this bit by bitwise and with x.

◆ operator|=()

Bitvector::Bit & Bitvector::Bit::operator|= ( bool  x)
inline

Modify this bit by bitwise or with x.

◆ operator^=()

Bitvector::Bit & Bitvector::Bit::operator^= ( bool  x)
inline

Modify this bit by bitwise exclusive or with x.

◆ operator-=()

Bitvector::Bit & Bitvector::Bit::operator-= ( bool  x)
inline

Modify this bit by bitwise subtraction with x.


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