libzypp 17.31.23
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

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

Macros

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

Functions

std::ostream & zypp::operator<< (std::ostream &str, const SetCompare &obj)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::ostream & zypp::operator<< (std::ostream &str, const SetRelation &obj)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetRelation::Enum &lhs, const SetCompare &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetRelation &lhs, const SetCompare::Enum &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetRelation &lhs, const SetCompare &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetCompare::Enum &lhs, const SetRelation::Enum &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetCompare::Enum &lhs, const SetRelation &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetCompare &lhs, const SetRelation::Enum &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator== (const SetCompare &lhs, const SetRelation &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetRelation::Enum &lhs, const SetCompare &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetRelation &lhs, const SetCompare::Enum &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetRelation &lhs, const SetCompare &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetCompare::Enum &lhs, const SetRelation::Enum &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetCompare::Enum &lhs, const SetRelation &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetCompare &lhs, const SetRelation::Enum &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool zypp::operator!= (const SetCompare &lhs, const SetRelation &rhs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

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 ); }
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator!=(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...

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 & );
#define SETRELATIONMIXIN_DEFINE_COMPARE_BETWEEN(DERIVED_TYPE, OTHER_TYPE)
Define compare between Derived and some other type (e.g.

Definition at line 212 of file SetRelationMixin.h.