12 #ifndef ZYPP_BASE_FUNCTIONAL_H
13 #define ZYPP_BASE_FUNCTIONAL_H
15 #include <boost/functional.hpp>
30 using boost::mem_fun_ref;
77 namespace functor_detail
80 template <
class _Functor,
class res_type>
96 template <
class _Functor,
class res_type,
class arg1_type>
97 struct FunctorRef1 :
public std::unary_function<arg1_type, res_type>
112 template <
class _Functor,
class res_type,
class arg1_type,
class arg2_type>
113 struct FunctorRef2 :
public std::binary_function<arg1_type, arg2_type, res_type>
142 : functor_detail::
FunctorRef2<_Functor, res_type, arg1_type, arg2_type>( f_r )
149 template <
class _Functor,
class res_type,
class arg1_type>
154 : functor_detail::FunctorRef1<_Functor, res_type, arg1_type>( f_r )
161 template <
class _Functor,
class res_type>
166 : functor_detail::FunctorRef0<_Functor, res_type>( f_r )
171 template <
class res_type,
class arg1_type,
class arg2_type,
class _Functor>
172 FunctorRef<_Functor, res_type, arg1_type, arg2_type>
175 template <
class res_type,
class arg1_type,
class _Functor>
176 FunctorRef<_Functor, res_type, arg1_type>
179 template <
class res_type,
class _Functor>
180 FunctorRef<_Functor, res_type>
272 template<
class _Condition>
289 template<
class _Condition>
297 template<
class _ACondition,
class _BCondition>
300 Or( _ACondition conda_r, _BCondition condb_r )
318 template<
class _ACondition,
class _BCondition>
326 template<
class _ACondition,
class _BCondition>
329 Chain( _ACondition conda_r, _BCondition condb_r )
347 template<
class _ACondition,
class _BCondition>
376 { *
_result = val_r;
return false; }
397 { *
_result = val_r;
return true; }
416 template<
class _OutputIterator>
425 { *(
_result++) = val_r;
return true; }
432 template<
class _OutputIterator>
445 #endif // ZYPP_BASE_FUNCTIONAL_H
Or< _ACondition, _BCondition > or_c(_ACondition conda_r, _BCondition condb_r)
Convenience function for creating a Or from two conditions conda_r OR condb_r.
Logical functor chaining _ACondition OR _BCondition.
bool operator()(_Tp) const
Store all results found to some output_iterator.
GetLast< _Tp > getLast(_Tp &result_r)
Convenience function for creating GetLast.
GetAll(_OutputIterator result_r)
GetFirst< _Tp > getFirst(_Tp &result_r)
Convenience function for creating GetFirst.
GetAll< _OutputIterator > getAll(_OutputIterator result_r)
Convenience function for creating GetAll.
FunctorRef2(_Functor &f_r)
False false_c()
Convenience function for creating a False.
res_type operator()() const
Chain(_ACondition conda_r, _BCondition condb_r)
res_type operator()(arg1_type a1, arg2_type a2) const
Chain< _ACondition, _BCondition > chain(_ACondition conda_r, _BCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
Logical functor always false.
Constant< T > constant(const T &value)
FunctorRef(_Functor &f_r)
bool operator()(_Tp) const
True true_c()
Convenience function for creating a True.
bool operator()(_Tp t) const
bool operator()(const _Tp &val_r)
FunctorRef< _Functor, res_type, arg1_type, arg2_type > functorRef(_Functor &f_r)
Convenience function creating a binary FunctorRef.
Strore the 1st result found in the variable passed to the ctor.
Logical functor chaining _ACondition AND _BCondition.
bool operator()(_Tp t) const
Strore the last result found in the variable passed to the ctor.
bool operator()(_Tp t) const
bool operator()(const _Tp &val_r) const
Not< _Condition > not_c(_Condition cond_r)
Convenience function for creating a Not from _Condition.
Or(_ACondition conda_r, _BCondition condb_r)
FunctorRef0(_Functor &f_r)
FunctorRef(_Functor &f_r)
Logical functor inverting _Condition.
Logical functor always true.
bool operator()(const _Tp &val_r)
FunctorRef1(_Functor &f_r)
FunctorRef(_Functor &f_r)
res_type operator()(arg1_type a1) const