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

An integral type used as BitField. More...

#include <Bit.h>

Inheritance diagram for zypp::bit::BitField< _IntT >:

List of all members.

Public Member Functions

 BitField ()
 Default ctor: zero.
 BitField (const _IntT &value_r)
 Ctor taking an _IntT.
template<class _Range >
_IntT value () const
 Return the value.
_IntT value () const
template<class _Range >
std::string asString () const
 Value as bit string.
std::string asString () const
template<class _Range >
BitFieldassign (_IntT rhs)
 Assign Range in rhs to this.
BitFieldassign (_IntT rhs)
template<class _Range >
bool isEqual (_IntT rhs) const
 Test for equal value within a Range.
bool isEqual (_IntT rhs) const
template<class _Range >
BitFieldset (_IntT rhs, bool doset_r)
 Set or unset bits of rhs.
BitFieldset (_IntT rhs, bool doset_r)
template<class _Range >
BitFieldset (_IntT rhs)
 Set bits of rhs.
BitFieldset (_IntT rhs)
template<class _Range >
BitFieldunset (_IntT rhs)
 Unset bits of rhs.
BitFieldunset (_IntT rhs)
template<class _Range >
bool test (_IntT rhs)
 Test whether all bits of rhs are set.
bool test (_IntT rhs) const
template<class _Range >
bool testAnyOf (_IntT rhs)
 Test whether at least one bit of rhs is set.
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 Types

typedef base::SafeBool
< BitField< _IntT >
>::bool_type 
bool_type

Private Member Functions

friend base::SafeBool () const
bool boolTest () const
 base::SafeBool test.

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)

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 161 of file Bit.h.


Member Typedef Documentation

template<class _IntT>
typedef base::SafeBool<BitField<_IntT> >::bool_type zypp::bit::BitField< _IntT >::bool_type [private]

Reimplemented from zypp::base::SafeBool< BitField< _IntT > >.

Definition at line 164 of file Bit.h.


Constructor & Destructor Documentation

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

Default ctor: zero.

Definition at line 168 of file Bit.h.

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

Ctor taking an _IntT.

Definition at line 172 of file Bit.h.


Member Function Documentation

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

Return the value.

Definition at line 183 of file Bit.h.

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

Definition at line 187 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 194 of file Bit.h.

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

Definition at line 198 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 205 of file Bit.h.

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

Definition at line 211 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 219 of file Bit.h.

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

Definition at line 224 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 233 of file Bit.h.

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

Definition at line 236 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 241 of file Bit.h.

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

Definition at line 244 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 249 of file Bit.h.

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

Definition at line 252 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 257 of file Bit.h.

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

Definition at line 260 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 265 of file Bit.h.

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

Definition at line 268 of file Bit.h.

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

Definition at line 273 of file Bit.h.

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

Definition at line 276 of file Bit.h.

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

Definition at line 279 of file Bit.h.

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

Definition at line 282 of file Bit.h.

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

Definition at line 285 of file Bit.h.

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

Definition at line 288 of file Bit.h.

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

Definition at line 291 of file Bit.h.

template<class _IntT>
zypp::bit::BitField< _IntT >::base::SafeBool ( ) const [private]
template<class _IntT>
bool zypp::bit::BitField< _IntT >::boolTest ( ) const [inline, private]

base::SafeBool test.

Definition at line 297 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 307 of file Bit.h.

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

Definition at line 314 of file Bit.h.

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

Definition at line 319 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,
const BitField< _IntT > &  rhs 
) [related]

Definition at line 330 of file Bit.h.

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

Definition at line 335 of file Bit.h.

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

Definition at line 340 of file Bit.h.

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

Definition at line 345 of file Bit.h.


Member Data Documentation

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

Definition at line 301 of file Bit.h.


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