PSCF v1.1
Public Member Functions | List of all members
Util::Bit Class Reference

Represents a specific bit location within an unsigned int. More...

#include <Bit.h>

Public Member Functions

 Bit ()
 Default constructor. More...
 
 Bit (unsigned int shift)
 Constructor. More...
 
void setMask (unsigned int shift)
 Set or reset the bit mask. More...
 
void set (unsigned int &flags) const
 Set this bit in the flags parameter. More...
 
void clear (unsigned int &flags) const
 Clear this bit in the flags parameter. More...
 
bool isSet (unsigned int flags) const
 Is this bit set in the flags integer? More...
 
unsigned int mask () const
 Return integer with only this bit set. More...
 

Detailed Description

Represents a specific bit location within an unsigned int.

Provides methods to query, set or clear a particular bit.

Definition at line 21 of file Bit.h.

Constructor & Destructor Documentation

◆ Bit() [1/2]

Util::Bit::Bit ( )

Default constructor.

Definition at line 18 of file Bit.cpp.

◆ Bit() [2/2]

Util::Bit::Bit ( unsigned int  shift)

Constructor.

Parameters
shiftlocation of the bit, 0 < shift <= 32.

Definition at line 25 of file Bit.cpp.

References setMask().

Member Function Documentation

◆ setMask()

void Util::Bit::setMask ( unsigned int  shift)

Set or reset the bit mask.

Parameters
shiftlocation of the bit, 0 < shift <= 32.

Definition at line 31 of file Bit.cpp.

References UTIL_THROW.

Referenced by Bit().

◆ set()

void Util::Bit::set ( unsigned int &  flags) const
inline

Set this bit in the flags parameter.

Parameters
flagsunsigned int to be modified

Definition at line 80 of file Bit.h.

◆ clear()

void Util::Bit::clear ( unsigned int &  flags) const
inline

Clear this bit in the flags parameter.

Parameters
flagsunsigned int to be modified

Definition at line 86 of file Bit.h.

◆ isSet()

bool Util::Bit::isSet ( unsigned int  flags) const
inline

Is this bit set in the flags integer?

Parameters
flagsunsigned int to be queried

Definition at line 92 of file Bit.h.

◆ mask()

unsigned int Util::Bit::mask ( ) const
inline

Return integer with only this bit set.

Definition at line 98 of file Bit.h.


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