TBTK
TBTK::BitRegister Class Reference

Public Member Functions

 BitRegister (unsigned int numBits=8 *sizeof(unsigned int))
 
 BitRegister (const BitRegister &bitRegister)
 
 ~BitRegister ()
 
const BitRegister operator| (const BitRegister &rhs) const
 
const BitRegister operator& (const BitRegister &rhs) const
 
const BitRegister operator^ (const BitRegister &rhs) const
 
const BitRegister operator+ (const BitRegister &rhs) const
 
const BitRegister operator- (const BitRegister &rhs) const
 
bool operator< (const BitRegister &rhs) const
 
bool operator> (const BitRegister &rhs) const
 
bool operator== (const BitRegister &rhs) const
 
void operator+= (const BitRegister &rhs)
 
void operator-= (const BitRegister &rhs)
 
const BitRegisteroperator++ ()
 
const BitRegister operator++ (int)
 
const BitRegisteroperator-- ()
 
const BitRegister operator-- (int)
 
void operator= (const BitRegister &rhs)
 
void operator= (unsigned int rhs)
 
BitRegister operator<< (unsigned int rhs) const
 
BitRegister operator>> (unsigned int rhs) const
 
void setBit (unsigned int position, bool values)
 
bool getBit (unsigned int position) const
 
void setValues (unsigned int values)
 
unsigned int getValues () const
 
bool toBool () const
 
unsigned int toUnsignedInt () const
 
void clear ()
 
void print () const
 
unsigned int getNumBits () const
 
unsigned int getNumOneBits () const
 
bool getMostSignificantBit () const
 
void setMostSignificantBit ()
 
void clearMostSignificantBit ()
 
BitRegister cloneStructure () const
 
unsigned int getAsUnsignedInt () const
 

Constructor & Destructor Documentation

TBTK::BitRegister::BitRegister ( unsigned int  numBits = 8 *sizeof(unsigned int))

Constructor.

TBTK::BitRegister::BitRegister ( const BitRegister bitRegister)

Copy constructor.

TBTK::BitRegister::~BitRegister ( )

Destructor.

Member Function Documentation

void TBTK::BitRegister::clear ( )
inline

Clear register.

void TBTK::BitRegister::clearMostSignificantBit ( )
inline

Clear the most significant bit.

BitRegister TBTK::BitRegister::cloneStructure ( ) const
inline

Create a new BitRegister with the same structure. (Provided to ensure the interface is similar with the interface for ExtensiveBitRegister.)

unsigned int TBTK::BitRegister::getAsUnsignedInt ( ) const

Return the value as an unsigned int.

bool TBTK::BitRegister::getBit ( unsigned int  position) const
inline

Get bit value.

bool TBTK::BitRegister::getMostSignificantBit ( ) const
inline

Returns the most significant bit.

unsigned int TBTK::BitRegister::getNumBits ( ) const
inline

Returns the number of bits in the register.

unsigned int TBTK::BitRegister::getNumOneBits ( ) const
inline

Returns the number of bits that are one.

unsigned int TBTK::BitRegister::getValues ( ) const
inline

Get values as unsigned int.

const BitRegister TBTK::BitRegister::operator& ( const BitRegister rhs) const
inline

Bitwise and operator.

const BitRegister TBTK::BitRegister::operator+ ( const BitRegister rhs) const
inline

Addition operator.

const BitRegister & TBTK::BitRegister::operator++ ( )
inline

Increment operator.

const BitRegister TBTK::BitRegister::operator++ ( int  )
inline

Increment operator.

void TBTK::BitRegister::operator+= ( const BitRegister rhs)
inline

+= operator.

const BitRegister TBTK::BitRegister::operator- ( const BitRegister rhs) const
inline

Subtraction operator.

const BitRegister & TBTK::BitRegister::operator-- ( )
inline

Decrement operator.

const BitRegister TBTK::BitRegister::operator-- ( int  )
inline

Decrement operator.

void TBTK::BitRegister::operator-= ( const BitRegister rhs)
inline

-= operator.

bool TBTK::BitRegister::operator< ( const BitRegister rhs) const
inline

Less than operator.

BitRegister TBTK::BitRegister::operator<< ( unsigned int  rhs) const
inline

Left bitshift operator.

void TBTK::BitRegister::operator= ( const BitRegister rhs)
inline

Assignment operator.

void TBTK::BitRegister::operator= ( unsigned int  rhs)
inline

Assignment operator.

bool TBTK::BitRegister::operator== ( const BitRegister rhs) const
inline

Comparison operator.

bool TBTK::BitRegister::operator> ( const BitRegister rhs) const
inline

Greater than operator.

BitRegister TBTK::BitRegister::operator>> ( unsigned int  rhs) const
inline

Right bitshift operator.

const BitRegister TBTK::BitRegister::operator^ ( const BitRegister rhs) const
inline

Bitwise xor operator.

const BitRegister TBTK::BitRegister::operator| ( const BitRegister rhs) const
inline

Bitwise or operator.

void TBTK::BitRegister::print ( ) const
inline

Print bit register.

void TBTK::BitRegister::setBit ( unsigned int  position,
bool  values 
)
inline

Set value of bit at a specific position.

void TBTK::BitRegister::setMostSignificantBit ( )
inline

Set the most significant bit.

void TBTK::BitRegister::setValues ( unsigned int  values)
inline

Set values as unsigned int.

bool TBTK::BitRegister::toBool ( ) const
inline

Returns a bool that is false if all bits are zero, and true otherwise.

unsigned int TBTK::BitRegister::toUnsignedInt ( ) const
inline

Returns an unsigned int containing the least significant bits.


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