libzypp  13.10.6
zypp::bit::BitField< _IntT > Class Template Reference

An integral type used as BitField. More...

#include <Bit.h>

Inheritance diagram for zypp::bit::BitField< _IntT >:
zypp::bit::Range< _IntT, 0, MaxBits< _IntT >::value >

Public Member Functions

 BitField ()
 Default ctor: zero. More...
 
 BitField (const _IntT &value_r)
 Ctor taking an _IntT. More...
 
 operator bool () const
 Validate in a boolean context. More...
 
template<class _Range >
_IntT value () const
 Return the value. More...
 
_IntT value () const
 
template<class _Range >
std::string asString () const
 Value as bit string. More...
 
std::string asString () const
 
template<class _Range >
BitFieldassign (_IntT rhs)
 Assign Range in rhs to this. More...
 
BitFieldassign (_IntT rhs)
 
template<class _Range >
bool isEqual (_IntT rhs) const
 Test for equal value within a Range. More...
 
bool isEqual (_IntT rhs) const
 
template<class _Range >
BitFieldset (_IntT rhs, bool doset_r)
 Set or unset bits of rhs. More...
 
BitFieldset (_IntT rhs, bool doset_r)
 
template<class _Range >
BitFieldset (_IntT rhs)
 Set bits of rhs. More...
 
BitFieldset (_IntT rhs)
 
template<class _Range >
BitFieldunset (_IntT rhs)
 Unset bits of rhs. More...
 
BitFieldunset (_IntT rhs)
 
template<class _Range >
bool test (_IntT rhs)
 Test whether all bits of rhs are set. More...
 
bool test (_IntT rhs) const
 
template<class _Range >
bool testAnyOf (_IntT rhs)
 Test whether at least one bit of rhs is set. More...
 
bool testAnyOf (_IntT rhs) const
 
BitFieldoperator= (const BitField &rhs)
 
BitFieldoperator&= (const BitField &rhs)
 
BitFieldoperator|= (const BitField &rhs)
 
BitFieldoperator^= (const BitField &rhs)
 
BitFieldoperator<<= (unsigned num)
 
BitFieldoperator>>= (unsigned num)
 
BitField operator~ () const
 

Private Attributes

_IntT _value
 

Related Functions

(Note that these are not member functions.)

template<class _IntT >
std::ostream & operator<< (std::ostream &str, const BitField< _IntT > &obj)
 
template<class _IntT >
bool operator== (const BitField< _IntT > &lhs, const BitField< _IntT > &rhs)
 
template<class _IntT >
bool operator!= (const BitField< _IntT > &lhs, const BitField< _IntT > &rhs)
 
template<class _IntT >
BitField< _IntT > operator& (const BitField< _IntT > &lhs, const BitField< _IntT > &rhs)
 
template<class _IntT >
BitField< _IntT > operator| (const BitField< _IntT > &lhs, const BitField< _IntT > &rhs)
 
template<class _IntT >
BitField< _IntT > operator^ (const BitField< _IntT > &lhs, const BitField< _IntT > &rhs)
 
template<class _IntT >
BitField< _IntT > operator<< (const BitField< _IntT > &lhs, unsigned num)
 
template<class _IntT >
BitField< _IntT > operator>> (const BitField< _IntT > &lhs, unsigned num)
 

Additional Inherited Members

- Public Types inherited from zypp::bit::Range< _IntT, 0, MaxBits< _IntT >::value >
typedef _IntT IntT
 
typedef zypp::bit::MaxBits< IntTMaxBits
 
typedef zypp::bit::Mask< IntT,
_begin, _size > 
Mask
 
- Static Public Attributes inherited from zypp::bit::Range< _IntT, 0, MaxBits< _IntT >::value >
static const unsigned begin
 
static const unsigned size
 
static const unsigned end
 

Detailed Description

template<class _IntT>
class zypp::bit::BitField< _IntT >

An integral type used as BitField.

Most methods exist as templated and nontemplated version. The nontemplated operates on the complete BitField, while the tamplated ones are restricted to the given Range.

* BitField<char> bf; // 00000000
* typedef Range<char,2,3> SubField; // bits 2,3,4 in a char field
*
* bf<SubField>.assign( -1 ); // assign SubField in -1
* // to SubField in bf.
* // 00011100
* bf.assign( -1 ); // assign -1 to bf
* // 11111111
* bf<SubField>.assign( 0 ); // 11100011
*

Definition at line 159 of file Bit.h.

Constructor & Destructor Documentation

template<class _IntT>
zypp::bit::BitField< _IntT >::BitField ( )
inline

Default ctor: zero.

Definition at line 163 of file Bit.h.

template<class _IntT>
zypp::bit::BitField< _IntT >::BitField ( const _IntT &  value_r)
inline

Ctor taking an _IntT.

Definition at line 167 of file Bit.h.

Member Function Documentation

template<class _IntT>
zypp::bit::BitField< _IntT >::operator bool ( ) const
inlineexplicit

Validate in a boolean context.

Definition at line 173 of file Bit.h.

template<class _IntT>
template<class _Range >
_IntT zypp::bit::BitField< _IntT >::value ( ) const
inline

Return the value.

Definition at line 179 of file Bit.h.

template<class _IntT>
_IntT zypp::bit::BitField< _IntT >::value ( ) const
inline

Definition at line 183 of file Bit.h.

template<class _IntT>
template<class _Range >
std::string zypp::bit::BitField< _IntT >::asString ( ) const
inline

Value as bit string.

Definition at line 190 of file Bit.h.

template<class _IntT>
std::string zypp::bit::BitField< _IntT >::asString ( ) const
inline

Definition at line 194 of file Bit.h.

template<class _IntT>
template<class _Range >
BitField& zypp::bit::BitField< _IntT >::assign ( _IntT  rhs)
inline

Assign Range in rhs to this.

Definition at line 201 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::assign ( _IntT  rhs)
inline

Definition at line 207 of file Bit.h.

template<class _IntT>
template<class _Range >
bool zypp::bit::BitField< _IntT >::isEqual ( _IntT  rhs) const
inline

Test for equal value within a Range.

Definition at line 215 of file Bit.h.

template<class _IntT>
bool zypp::bit::BitField< _IntT >::isEqual ( _IntT  rhs) const
inline

Definition at line 220 of file Bit.h.

template<class _IntT>
template<class _Range >
BitField& zypp::bit::BitField< _IntT >::set ( _IntT  rhs,
bool  doset_r 
)
inline

Set or unset bits of rhs.

Definition at line 229 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::set ( _IntT  rhs,
bool  doset_r 
)
inline

Definition at line 232 of file Bit.h.

template<class _IntT>
template<class _Range >
BitField& zypp::bit::BitField< _IntT >::set ( _IntT  rhs)
inline

Set bits of rhs.

Definition at line 237 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::set ( _IntT  rhs)
inline

Definition at line 240 of file Bit.h.

template<class _IntT>
template<class _Range >
BitField& zypp::bit::BitField< _IntT >::unset ( _IntT  rhs)
inline

Unset bits of rhs.

Definition at line 245 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::unset ( _IntT  rhs)
inline

Definition at line 248 of file Bit.h.

template<class _IntT>
template<class _Range >
bool zypp::bit::BitField< _IntT >::test ( _IntT  rhs)
inline

Test whether all bits of rhs are set.

Definition at line 253 of file Bit.h.

template<class _IntT>
bool zypp::bit::BitField< _IntT >::test ( _IntT  rhs) const
inline

Definition at line 256 of file Bit.h.

template<class _IntT>
template<class _Range >
bool zypp::bit::BitField< _IntT >::testAnyOf ( _IntT  rhs)
inline

Test whether at least one bit of rhs is set.

Definition at line 261 of file Bit.h.

template<class _IntT>
bool zypp::bit::BitField< _IntT >::testAnyOf ( _IntT  rhs) const
inline

Definition at line 264 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::operator= ( const BitField< _IntT > &  rhs)
inline

Definition at line 269 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::operator&= ( const BitField< _IntT > &  rhs)
inline

Definition at line 272 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::operator|= ( const BitField< _IntT > &  rhs)
inline

Definition at line 275 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::operator^= ( const BitField< _IntT > &  rhs)
inline

Definition at line 278 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::operator<<= ( unsigned  num)
inline

Definition at line 281 of file Bit.h.

template<class _IntT>
BitField& zypp::bit::BitField< _IntT >::operator>>= ( unsigned  num)
inline

Definition at line 284 of file Bit.h.

template<class _IntT>
BitField zypp::bit::BitField< _IntT >::operator~ ( ) const
inline

Definition at line 287 of file Bit.h.

Friends And Related Function Documentation

template<class _IntT >
std::ostream & operator<< ( std::ostream &  str,
const BitField< _IntT > &  obj 
)
related

Stream output

Definition at line 297 of file Bit.h.

template<class _IntT >
bool operator== ( const BitField< _IntT > &  lhs,
const BitField< _IntT > &  rhs 
)
related

Definition at line 304 of file Bit.h.

template<class _IntT >
bool operator!= ( const BitField< _IntT > &  lhs,
const BitField< _IntT > &  rhs 
)
related

Definition at line 309 of file Bit.h.

template<class _IntT >
BitField< _IntT > operator& ( const BitField< _IntT > &  lhs,
const BitField< _IntT > &  rhs 
)
related

Definition at line 315 of file Bit.h.

template<class _IntT >
BitField< _IntT > operator| ( const BitField< _IntT > &  lhs,
const BitField< _IntT > &  rhs 
)
related

Definition at line 320 of file Bit.h.

template<class _IntT >
BitField< _IntT > operator^ ( const BitField< _IntT > &  lhs,
const BitField< _IntT > &  rhs 
)
related

Definition at line 325 of file Bit.h.

template<class _IntT >
BitField< _IntT > operator<< ( const BitField< _IntT > &  lhs,
unsigned  num 
)
related

Definition at line 330 of file Bit.h.

template<class _IntT >
BitField< _IntT > operator>> ( const BitField< _IntT > &  lhs,
unsigned  num 
)
related

Definition at line 335 of file Bit.h.

Member Data Documentation

template<class _IntT>
_IntT zypp::bit::BitField< _IntT >::_value
private

Definition at line 291 of file Bit.h.


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