libzypp  13.10.6
zypp::base::Flags< Enum > Class Template Reference

A type-safe way of storing OR-combinations of enum values (like QTs QFlags). More...

#include <Flags.h>

Public Types

typedef Enum enum_type
 

Public Member Functions

 Flags ()
 
 Flags (Enum flag_r)
 
 Flags (unsigned flag_r)
 
Flagsoperator&= (Flags rhs)
 
Flagsoperator&= (Enum rhs)
 
Flagsoperator|= (Flags rhs)
 
Flagsoperator|= (Enum rhs)
 
Flagsoperator^= (Flags rhs)
 
Flagsoperator^= (Enum rhs)
 
 operator unsigned () const
 
Flags operator& (Flags rhs) const
 
Flags operator& (Enum rhs) const
 
Flags operator| (Flags rhs) const
 
Flags operator| (Enum rhs) const
 
Flags operator^ (Flags rhs) const
 
Flags operator^ (Enum rhs) const
 
Flags operator~ () const
 
FlagssetFlag (Flags flag_r, bool newval_r)
 
FlagssetFlag (Enum flag_r, bool newval_r)
 
FlagssetFlag (Flags flag_r)
 
FlagssetFlag (Enum flag_r)
 
FlagsunsetFlag (Flags flag_r)
 
FlagsunsetFlag (Enum flag_r)
 
bool testFlag (Flags flag_r) const
 
bool testFlag (Enum flag_r) const
 

Private Attributes

unsigned _val
 

Detailed Description

template<typename Enum>
class zypp::base::Flags< Enum >

A type-safe way of storing OR-combinations of enum values (like QTs QFlags).

See Also
QFlags Class Reference
* class RpmDb
* {
* public:
* enum DbStateInfoBits {
* DbSI_NO_INIT = 0x0000,
* DbSI_HAVE_V4 = 0x0001,
* DbSI_MADE_V4 = 0x0002,
* DbSI_MODIFIED_V4 = 0x0004,
* DbSI_HAVE_V3 = 0x0008,
* DbSI_HAVE_V3TOV4 = 0x0010,
* DbSI_MADE_V3TOV4 = 0x0020
* };
*
* ZYPP_DECLARE_FLAGS(DbStateInfo,DbStateInfoBits);
* };
* ZYPP_DECLARE_OPERATORS_FOR_FLAGS(RpmDb::DbStateInfo);
*
* ...
* enum Other { OTHERVAL = 13 };
* {
* XRpmDb::DbStateInfo s;
* s = XRpmDb::DbSI_MODIFIED_V4|XRpmDb::DbSI_HAVE_V4;
* // s |= OTHERVAL; // As desired: it does not compile
* }
*

Definition at line 58 of file Flags.h.

Member Typedef Documentation

template<typename Enum >
typedef Enum zypp::base::Flags< Enum >::enum_type

Definition at line 61 of file Flags.h.

Constructor & Destructor Documentation

template<typename Enum >
zypp::base::Flags< Enum >::Flags ( )
inline

Definition at line 64 of file Flags.h.

template<typename Enum >
zypp::base::Flags< Enum >::Flags ( Enum  flag_r)
inline

Definition at line 65 of file Flags.h.

template<typename Enum >
zypp::base::Flags< Enum >::Flags ( unsigned  flag_r)
inlineexplicit

Definition at line 66 of file Flags.h.

Member Function Documentation

template<typename Enum >
Flags& zypp::base::Flags< Enum >::operator&= ( Flags< Enum >  rhs)
inline

Definition at line 68 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::operator&= ( Enum  rhs)
inline

Definition at line 69 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::operator|= ( Flags< Enum >  rhs)
inline

Definition at line 71 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::operator|= ( Enum  rhs)
inline

Definition at line 72 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::operator^= ( Flags< Enum >  rhs)
inline

Definition at line 74 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::operator^= ( Enum  rhs)
inline

Definition at line 75 of file Flags.h.

template<typename Enum >
zypp::base::Flags< Enum >::operator unsigned ( ) const
inline

Definition at line 78 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator& ( Flags< Enum >  rhs) const
inline

Definition at line 80 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator& ( Enum  rhs) const
inline

Definition at line 81 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator| ( Flags< Enum >  rhs) const
inline

Definition at line 83 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator| ( Enum  rhs) const
inline

Definition at line 84 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator^ ( Flags< Enum >  rhs) const
inline

Definition at line 86 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator^ ( Enum  rhs) const
inline

Definition at line 87 of file Flags.h.

template<typename Enum >
Flags zypp::base::Flags< Enum >::operator~ ( ) const
inline

Definition at line 89 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::setFlag ( Flags< Enum >  flag_r,
bool  newval_r 
)
inline

Definition at line 92 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::setFlag ( Enum  flag_r,
bool  newval_r 
)
inline

Definition at line 93 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::setFlag ( Flags< Enum >  flag_r)
inline

Definition at line 95 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::setFlag ( Enum  flag_r)
inline

Definition at line 96 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::unsetFlag ( Flags< Enum >  flag_r)
inline

Definition at line 98 of file Flags.h.

template<typename Enum >
Flags& zypp::base::Flags< Enum >::unsetFlag ( Enum  flag_r)
inline

Definition at line 99 of file Flags.h.

template<typename Enum >
bool zypp::base::Flags< Enum >::testFlag ( Flags< Enum >  flag_r) const
inline

Definition at line 101 of file Flags.h.

template<typename Enum >
bool zypp::base::Flags< Enum >::testFlag ( Enum  flag_r) const
inline

Definition at line 102 of file Flags.h.

Member Data Documentation

template<typename Enum >
unsigned zypp::base::Flags< Enum >::_val
private

Definition at line 105 of file Flags.h.


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