libzypp  17.38.7
zypp::bit Namespace Reference

Namespaces

 bit_detail
 

Classes

class  BitField
 An integral type used as BitField. More...
 
struct  Mask
 A bitmaks of _size 1-bits starting at bit _begin. More...
 
struct  MaxBits
 Number of bits available in TInt. More...
 
struct  Range
 Range of bits starting at bit _begin with length _size. More...
 
struct  Range< TInt, _begin, 0 >
 Range specialisation for (illegal) zero _size. More...
 
struct  RangeBit
 A single 1-bit within a Range. More...
 
struct  RangeValue
 A value with in a Range. More...
 

Functions

template<class TInt >
std::string asString (TInt val, char zero='0', char one='1')
 For printing bits. More...
 
template<class TInt >
std::ostream & operator<< (std::ostream &str, const BitField< TInt > &obj)
 relates: BitField Stream output More...
 
template<class TInt >
bool operator== (const BitField< TInt > &lhs, const BitField< TInt > &rhs)
 relates: BitField More...
 
template<class TInt >
bool operator!= (const BitField< TInt > &lhs, const BitField< TInt > &rhs)
 relates: BitField More...
 
template<class TInt >
BitField< TInt > operator & (const BitField< TInt > &lhs, const BitField< TInt > &rhs)
 relates: BitField More...
 
template<class TInt >
BitField< TInt > operator| (const BitField< TInt > &lhs, const BitField< TInt > &rhs)
 relates: BitField More...
 
template<class TInt >
BitField< TInt > operator^ (const BitField< TInt > &lhs, const BitField< TInt > &rhs)
 relates: BitField More...
 
template<class TInt >
BitField< TInt > operator<< (const BitField< TInt > &lhs, unsigned num)
 relates: BitField More...
 
template<class TInt >
BitField< TInt > operator>> (const BitField< TInt > &lhs, unsigned num)
 relates: BitField More...
 

Detailed Description

Todo:
Use boost::mpl library to assert constraints at compiletime! There various like (TInt is an integral type) (begin+size < maxbits) or ( field dependent constants must be within the range defined by size ).

Function Documentation

◆ asString()

template<class TInt >
std::string zypp::bit::asString ( TInt  val,
char  zero = '0',
char  one = '1' 
)
inline

For printing bits.

Definition at line 57 of file Bit.h.

◆ operator<<() [1/2]

template<class TInt >
std::ostream& zypp::bit::operator<< ( std::ostream &  str,
const BitField< TInt > &  obj 
)

relates: BitField Stream output

Definition at line 297 of file Bit.h.

◆ operator==()

template<class TInt >
bool zypp::bit::operator== ( const BitField< TInt > &  lhs,
const BitField< TInt > &  rhs 
)
inline

relates: BitField

Definition at line 304 of file Bit.h.

◆ operator!=()

template<class TInt >
bool zypp::bit::operator!= ( const BitField< TInt > &  lhs,
const BitField< TInt > &  rhs 
)
inline

relates: BitField

Definition at line 309 of file Bit.h.

◆ operator &()

template<class TInt >
BitField<TInt> zypp::bit::operator& ( const BitField< TInt > &  lhs,
const BitField< TInt > &  rhs 
)
inline

relates: BitField

Definition at line 315 of file Bit.h.

◆ operator|()

template<class TInt >
BitField<TInt> zypp::bit::operator| ( const BitField< TInt > &  lhs,
const BitField< TInt > &  rhs 
)
inline

relates: BitField

Definition at line 320 of file Bit.h.

◆ operator^()

template<class TInt >
BitField<TInt> zypp::bit::operator^ ( const BitField< TInt > &  lhs,
const BitField< TInt > &  rhs 
)
inline

relates: BitField

Definition at line 325 of file Bit.h.

◆ operator<<() [2/2]

template<class TInt >
BitField<TInt> zypp::bit::operator<< ( const BitField< TInt > &  lhs,
unsigned  num 
)
inline

relates: BitField

Definition at line 330 of file Bit.h.

◆ operator>>()

template<class TInt >
BitField<TInt> zypp::bit::operator>> ( const BitField< TInt > &  lhs,
unsigned  num 
)
inline

relates: BitField

Definition at line 335 of file Bit.h.