libzypp  17.38.7
SetRelationMixin.h File Reference
#include <iosfwd>
#include <string>
#include <zypp-core/base/Easy.h>
#include <zypp-core/base/EnumClass.h>
Include dependency graph for SetRelationMixin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  zypp::ESetCompareDef
 Result of set comparison (use like 'enum class SetCompare') This is the type a compare function should return. More...
 
class  zypp::ESetRelationDef
 Set Relation based on SetCompare (use like 'enum class SetRelation') Comparison (== !=) between SetRelation and SetCompare is defined to let SetRelation::subset match SetCompare::equal as well as SetCompare::properSubset. More...
 
class  zypp::base::SetRelationMixin< Derived >
 Provide set relation methods based on Derived::setRelationMixinCompare A class using this mixin must provide: More...
 

Namespaces

 zypp
 Easy-to use interface to the ZYPP dependency resolver.
 
 zypp::base
 

Macros

#define SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN(DERIVED_TYPE, OTHER_TYPE)
 relates: SetRelationMixin Define compare between Derived and some other type (e.g. More...
 

Typedefs

using zypp::SetCompare = base::EnumClass< ESetCompareDef >
 relates: ESetCompareDef typedef 'enum class SetCompare' More...
 
using zypp::SetRelation = base::EnumClass< ESetRelationDef >
 relates: ESetRelationDef typedef 'enum class SetRelation' More...
 

Functions

std::ostream & zypp::operator<< (std::ostream &str, const SetCompare::Enum &obj)
 relates: SetCompare Stream output More...
 
std::ostream & zypp::operator<< (std::ostream &str, const SetCompare &obj)
 
std::ostream & zypp::operator<< (std::ostream &str, const SetRelation::Enum &obj)
 relates: SetRelation Stream output More...
 
std::ostream & zypp::operator<< (std::ostream &str, const SetRelation &obj)
 
bool zypp::operator== (const SetRelation::Enum &lhs, const SetCompare::Enum &rhs)
 relates: SetRelation relates: SetCompare Matching SetCompare and SetRelation More...
 
bool zypp::operator== (const SetRelation::Enum &lhs, const SetCompare &rhs)
 
bool zypp::operator== (const SetRelation &lhs, const SetCompare::Enum &rhs)
 
bool zypp::operator== (const SetRelation &lhs, const SetCompare &rhs)
 
bool zypp::operator== (const SetCompare::Enum &lhs, const SetRelation::Enum &rhs)
 
bool zypp::operator== (const SetCompare::Enum &lhs, const SetRelation &rhs)
 
bool zypp::operator== (const SetCompare &lhs, const SetRelation::Enum &rhs)
 
bool zypp::operator== (const SetCompare &lhs, const SetRelation &rhs)
 
bool zypp::operator!= (const SetRelation::Enum &lhs, const SetCompare::Enum &rhs)
 relates: SetRelation relates: SetCompare Matching SetCompare and SetRelation More...
 
bool zypp::operator!= (const SetRelation::Enum &lhs, const SetCompare &rhs)
 
bool zypp::operator!= (const SetRelation &lhs, const SetCompare::Enum &rhs)
 
bool zypp::operator!= (const SetRelation &lhs, const SetCompare &rhs)
 
bool zypp::operator!= (const SetCompare::Enum &lhs, const SetRelation::Enum &rhs)
 
bool zypp::operator!= (const SetCompare::Enum &lhs, const SetRelation &rhs)
 
bool zypp::operator!= (const SetCompare &lhs, const SetRelation::Enum &rhs)
 
bool zypp::operator!= (const SetCompare &lhs, const SetRelation &rhs)
 
template<class Derived >
SetCompare zypp::base::compare (const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg)
 relates: SetRelationMixin Compare sets More...
 
template<class Derived >
bool zypp::base::compare (const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg, SetCompare cmp)
 relates: SetRelationMixin Compare sets and match against SetCompare More...
 
template<class Derived >
bool zypp::base::compare (const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg, SetRelation rel)
 relates: SetRelationMixin Compare sets and match against SetRelation More...
 
template<class Derived >
bool zypp::base::operator== (const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg)
 relates: SetRelationMixin Equal More...
 
template<class Derived >
bool zypp::base::operator!= (const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg)
 relates: SetRelationMixin Unequal More...
 

Macro Definition Documentation

◆ SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN

#define SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN (   DERIVED_TYPE,
  OTHER_TYPE 
)
Value:
inline SetCompare compare( const base::SetRelationMixin<DERIVED_TYPE> & src, OTHER_TYPE trg ) \
{ return src.compare( DERIVED_TYPE(trg) ); } \
inline SetCompare compare( OTHER_TYPE src, const base::SetRelationMixin<DERIVED_TYPE> & trg ) \
{ return DERIVED_TYPE(src).compare( trg ); } \
\
inline bool compare( const base::SetRelationMixin<DERIVED_TYPE> & src, OTHER_TYPE trg, SetCompare cmp ) \
{ return src.compare( DERIVED_TYPE(trg), cmp ); } \
inline bool compare( OTHER_TYPE src, const base::SetRelationMixin<DERIVED_TYPE> & trg, SetCompare cmp ) \
{ return DERIVED_TYPE(src).compare( trg, cmp ); } \
\
inline bool compare( const base::SetRelationMixin<DERIVED_TYPE> & src, OTHER_TYPE trg, SetRelation rel ) \
{ return src.compare( DERIVED_TYPE(trg), rel ); } \
inline bool compare( OTHER_TYPE src, const base::SetRelationMixin<DERIVED_TYPE> & trg, SetRelation rel ) \
{ return DERIVED_TYPE(src).compare( trg, rel ); } \
\
inline bool operator==( const base::SetRelationMixin<DERIVED_TYPE> & src, OTHER_TYPE trg ) \
{ return src.compare( DERIVED_TYPE(trg), SetRelation::equal ); } \
inline bool operator==( OTHER_TYPE src, const base::SetRelationMixin<DERIVED_TYPE> & trg ) \
{ return DERIVED_TYPE(src).compare( trg, SetRelation::equal ); } \
\
inline bool operator!=( const base::SetRelationMixin<DERIVED_TYPE> & src, OTHER_TYPE trg ) \
{ return !( src == trg ); } \
inline bool operator!=( OTHER_TYPE src, const base::SetRelationMixin<DERIVED_TYPE> & trg ) \
{ return !( src == trg ); }
base::EnumClass< ESetRelationDef > SetRelation
relates: ESetRelationDef typedef &#39;enum class SetRelation&#39;
base::EnumClass< ESetCompareDef > SetCompare
relates: ESetCompareDef typedef &#39;enum class SetCompare&#39;
bool operator==(const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg)
relates: SetRelationMixin Equal
bool compare(const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg, SetRelation rel)
relates: SetRelationMixin Compare sets and match against SetRelation
bool operator!=(const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg)
relates: SetRelationMixin Unequal

relates: SetRelationMixin Define compare between Derived and some other type (e.g.

std::string)

class Foo : public base::SetRelationMixin<Foo> {...};
SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN( Foo, const std::string & );

Definition at line 212 of file SetRelationMixin.h.