libzypp  17.14.0
SetRelationMixin.h File Reference
#include <iosfwd>
#include <string>
#include "zypp/base/Easy.h"
#include "zypp/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)
 

Functions

std::ostream & zypp::operator<< (std::ostream &str, const SetCompare &obj)
 
std::ostream & zypp::operator<< (std::ostream &str, const SetRelation &obj)
 
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 &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)
 

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
base::EnumClass< ESetCompareDef > SetCompare
bool operator!=(const Arch::CompatEntry &lhs, const Arch::CompatEntry &rhs)
Definition: Arch.cc:127
SetCompare compare(const SetRelationMixin< Derived > &src, const SetRelationMixin< Derived > &trg)
bool operator==(const Arch::CompatEntry &lhs, const Arch::CompatEntry &rhs)
Definition: Arch.cc:124

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.