All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Classes | Namespaces | Macros | Functions
functors.hpp File Reference

This file contains set of simple useful functors or functor adapters. More...

#include "paal/utils/type_functions.hpp"
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/iterator_range.hpp>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <tuple>
#include <utility>

Go to the source code of this file.

Classes

struct  paal::utils::ignore_param
 Type that can be constructed from anything and has no other functionality. More...
 
struct  paal::utils::skip_functor
 Functor does nothing. More...
 
struct  paal::utils::return_constant_functor< T, t >
 Functor returns always the same number. The number has to be known at compile time. More...
 
struct  paal::utils::dynamic_return_constant_functor< T >
 Functor returns always the same number (dynamic version). More...
 
struct  paal::utils::identity_functor
 functor returns its argument More...
 
class  paal::utils::tuple_uncurry< F >
 transforms a functor taking multiple parameters into a functor taking a tuple parameter. More...
 
struct  paal::utils::always_false
 functor return false More...
 
struct  paal::utils::always_true
 functor return true More...
 
struct  paal::utils::return_zero_functor
 functor returns 0 More...
 
struct  paal::utils::return_one_functor
 functor returns 1 More...
 
struct  paal::utils::assert_functor
 functors calls assert(false). More...
 
struct  paal::utils::remove_reference
 removes reference More...
 
class  paal::utils::counting_functor_adaptor< Functor, CounterType >
 Counts number of calls. More...
 
class  paal::utils::array_to_functor< Array >
 Adapts array as function, providing operator()(). More...
 
struct  paal::utils::assignable_functor< Functor >
 Wrapper around a functor which adds assigmnent operator as well as default constructor. Note, this struct might be dangerous. Using this struct correctly requires the underlying functor to live at least as long as this wrapper. More...
 
struct  paal::utils::lift_iterator_functor< Functor >
 For given functor f, lift_iterator_functor provides operator()(Iterator iterator) which returns f(*iter). More...
 
struct  paal::utils::greater
 greater functor More...
 
struct  paal::utils::less
 less functor More...
 
struct  paal::utils::greater_equal
 greater_equal functor More...
 
struct  paal::utils::less_equal
 less_equal functor More...
 
struct  paal::utils::equal_to
 equal_to functor More...
 
struct  paal::utils::equal_to_unspecified
 TODO equivalent to c++14 equal_to<>, remove when appears. More...
 
struct  paal::utils::not_equal_to
 not_equal_to functor More...
 
struct  paal::utils::functor_to_comparator< Functor, Compare >
 
struct  paal::utils::scale_functor< Functor, ScaleType, ReturnType >
 Functor that scales another functor. More...
 
struct  paal::utils::plus
 plus More...
 
struct  paal::utils::minus
 minus More...
 
struct  paal::utils::max
 max More...
 
struct  paal::utils::min
 min More...
 
struct  paal::utils::Not
 Not. More...
 
struct  paal::utils::Or
 Or. More...
 
struct  paal::utils::And
 And. More...
 
struct  paal::utils::lift_binary_operator_functor< FunctorLeft, FunctorRight, Operator >
 
struct  paal::utils::not_functor< Functor >
 not_functor More...
 
struct  paal::utils::or_functor< FunctorLeft, FunctorRight >
 or_functor More...
 
struct  paal::utils::and_functor< FunctorLeft, FunctorRight >
 and_functor More...
 
struct  paal::utils::xor_functor< FunctorLeft, FunctorRight >
 xor_functor More...
 
struct  paal::utils::tuple_get< I >
 functor for std::tuple::get<I> More...
 

Namespaces

 paal
 global namespace of project.
 
 paal::utils
 Utils namespace.
 

Functions

template<typename T >
auto paal::utils::make_dynamic_return_constant_functor (T t)
 make function for dynamic_return_constant_functor More...
 
template<typename F , typename G >
auto paal::utils::compose (F f, G g)
 functor composition: x -> f(g(x)) More...
 
template<typename F , typename... Fs>
auto paal::utils::compose (F f, Fs...fs)
 functor composition, variadic case More...
 
template<typename T >
void paal::utils::detail::get (T t)
 necessary for ADL to work for get
 
template<class F >
auto paal::utils::make_tuple_uncurry (F f)
 make for tuple_uncurry More...
 
template<typename CounterType = int, typename Functor >
auto paal::utils::make_counting_functor_adaptor (Functor f, CounterType &cnt)
 make function for counting_functor_adaptor More...
 
template<typename Array >
auto paal::utils::make_array_to_functor (const Array &a, int offset=0)
 make function for array_to_functor More...
 
template<typename Functor >
auto paal::utils::make_assignable_functor (Functor &f)
 make function for assignable_functor More...
 
template<typename Functor >
auto paal::utils::make_lift_iterator_functor (Functor f)
 make function for lift_iterator_functor More...
 
template<typename Functor , typename Compare = less>
auto paal::utils::make_functor_to_comparator (Functor functor, Compare compare=Compare())
 make for functor to comparator More...
 
template<typename ScaleType , typename ReturnType = ScaleType, typename Functor >
auto paal::utils::make_scale_functor (Functor f, ScaleType s)
 make for scale_functor More...
 
template<typename FunctorLeft , typename FunctorRight , typename Operator >
auto paal::utils::make_lift_binary_operator_functor (FunctorLeft left, FunctorRight right, Operator op)
 make function for lift_binary_operator_functor More...
 
template<typename Functor >
auto paal::utils::make_not_functor (Functor functor)
 make for Not
 
template<typename FunctorLeft , typename FunctorRight >
auto paal::utils::make_or_functor (FunctorLeft left, FunctorRight right)
 make for or_functor
 
template<typename FunctorLeft , typename FunctorRight >
auto paal::utils::make_and_functor (FunctorLeft left, FunctorRight right)
 make and_functor
 
template<typename FunctorLeft , typename FunctorRight >
auto paal::utils::make_xor_functor (FunctorLeft left, FunctorRight right)
 make for Xor
 

Detailed Description

This file contains set of simple useful functors or functor adapters.

Author
Piotr Wygocki, Robert Rosolek, Andrzej Pacuk
Version
1.0
Date
2013-02-01

Definition in file functors.hpp.