functional.hpp File Reference

#include "config.hpp"
#include <functional>
#include "basefuncs.hpp"
#include "function_traits.hpp"
#include "factory.hpp"
#include "cmp.hpp"

Go to the source code of this file.

Namespaces

namespace  Arageli
namespace  Arageli::func
namespace  Arageli::gfunc

Classes

struct  Arageli::func::is_null< T >
struct  Arageli::func::is_unit< T >
struct  Arageli::func::is_opposite_unit< T >
struct  Arageli::func::is_negative< T >
struct  Arageli::func::is_positive< T >
struct  Arageli::func::sign< T >
struct  Arageli::func::is_prime< T >
struct  Arageli::func::is_even< T >
struct  Arageli::func::is_odd< T >
struct  Arageli::func::indirection< Arg, Res >
struct  Arageli::func::address< Arg, Res >
struct  Arageli::func::unary_plus< Arg, Res >
struct  Arageli::func::unary_minus< Arg, Res >
struct  Arageli::func::logical_not< Arg, Res >
struct  Arageli::func::bitwise_not< Arg, Res >
struct  Arageli::func::prefix_increment< Arg, Res >
struct  Arageli::func::prefix_decrement< Arg, Res >
struct  Arageli::func::postfix_increment< Arg, Res >
struct  Arageli::func::postfix_decrement< Arg, Res >
struct  Arageli::func::plus< Arg1, Arg2, Res >
struct  Arageli::func::minus< Arg1, Arg2, Res >
struct  Arageli::func::multiplies< Arg1, Arg2, Res >
struct  Arageli::func::divides< Arg1, Arg2, Res >
struct  Arageli::func::modulus< Arg1, Arg2, Res >
struct  Arageli::func::logical_or< Arg1, Arg2, Res >
struct  Arageli::func::logical_and< Arg1, Arg2, Res >
struct  Arageli::func::equal_to< Arg1, Arg2, Res >
struct  Arageli::func::not_equal_to< Arg1, Arg2, Res >
struct  Arageli::func::greater< Arg1, Arg2, Res >
struct  Arageli::func::less< Arg1, Arg2, Res >
struct  Arageli::func::greater_equal< Arg1, Arg2, Res >
struct  Arageli::func::less_equal< Arg1, Arg2, Res >
struct  Arageli::func::bitwise_or< Arg1, Arg2, Res >
struct  Arageli::func::bitwise_and< Arg1, Arg2, Res >
struct  Arageli::func::bitwise_xor< Arg1, Arg2, Res >
struct  Arageli::func::shift_left< Arg1, Arg2, Res >
struct  Arageli::func::shift_right< Arg1, Arg2, Res >
struct  Arageli::func::assign< Arg1, Arg2, Res >
struct  Arageli::func::assign_plus< Arg1, Arg2, Res >
struct  Arageli::func::assign_minus< Arg1, Arg2, Res >
struct  Arageli::func::assign_multiplies< Arg1, Arg2, Res >
struct  Arageli::func::assign_divides< Arg1, Arg2, Res >
struct  Arageli::func::assign_modulus< Arg1, Arg2, Res >
struct  Arageli::func::assign_bitwise_or< Arg1, Arg2, Res >
struct  Arageli::func::assign_bitwise_and< Arg1, Arg2, Res >
struct  Arageli::func::assign_bitwise_xor< Arg1, Arg2, Res >
struct  Arageli::func::assign_shift_left< Arg1, Arg2, Res >
struct  Arageli::func::assign_shift_right< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_plus< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_minus< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_multiplies< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_divides< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_modulus< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_bitwise_or< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_bitwise_and< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_bitwise_xor< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_shift_left< Arg1, Arg2, Res >
struct  Arageli::func::right_assign_shift_right< Arg1, Arg2, Res >
struct  Arageli::func::parentheses_0< Arg, Res >
struct  Arageli::func::parentheses_1< Arg1, Arg2, Res >
struct  Arageli::func::subscript< Arg1, Arg2, Res >
struct  Arageli::func::swap_args< Func, Arg1, Arg2, Res >
struct  Arageli::gfunc::cmp
struct  Arageli::gfunc::by_tag< function_tag::indirection >
struct  Arageli::gfunc::by_tag< function_tag::address >
struct  Arageli::gfunc::by_tag< function_tag::unary_plus >
struct  Arageli::gfunc::by_tag< function_tag::unary_minus >
struct  Arageli::gfunc::by_tag< function_tag::logical_not >
struct  Arageli::gfunc::by_tag< function_tag::bitwise_not >
struct  Arageli::gfunc::by_tag< function_tag::prefix_increment >
struct  Arageli::gfunc::by_tag< function_tag::prefix_decrement >
struct  Arageli::gfunc::by_tag< function_tag::postfix_increment >
struct  Arageli::gfunc::by_tag< function_tag::postfix_decrement >
struct  Arageli::gfunc::by_tag< function_tag::plus >
struct  Arageli::gfunc::by_tag< function_tag::minus >
struct  Arageli::gfunc::by_tag< function_tag::multiplies >
struct  Arageli::gfunc::by_tag< function_tag::divides >
struct  Arageli::gfunc::by_tag< function_tag::modulus >
struct  Arageli::gfunc::by_tag< function_tag::logical_or >
struct  Arageli::gfunc::by_tag< function_tag::logical_and >
struct  Arageli::gfunc::by_tag< function_tag::equal_to >
struct  Arageli::gfunc::by_tag< function_tag::not_equal_to >
struct  Arageli::gfunc::by_tag< function_tag::greater >
struct  Arageli::gfunc::by_tag< function_tag::less >
struct  Arageli::gfunc::by_tag< function_tag::greater_equal >
struct  Arageli::gfunc::by_tag< function_tag::less_equal >
struct  Arageli::gfunc::by_tag< function_tag::bitwise_or >
struct  Arageli::gfunc::by_tag< function_tag::bitwise_and >
struct  Arageli::gfunc::by_tag< function_tag::bitwise_xor >
struct  Arageli::gfunc::by_tag< function_tag::shift_left >
struct  Arageli::gfunc::by_tag< function_tag::shift_right >

A test for primality.

template<typename T>
bool Arageli::is_prime (const T &x)
 Determines if x is prime via appropriate algorithm for T.

Defines

#define _ARAGELI_FUNC_BUILDER_1(NAME, RES)
#define _ARAGELI_UNARY_OPERATOR_FUNC_BUILDER_1(NAME, OPER)
#define _ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1(NAME, OPER)
#define _ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_2(NAME, OPER)
#define _ARAGELI_FUNC_BUILDER_1(NAME, RES)
#define _ARAGELI_FUNC_BUILDER_2(NAME, RES)
#define ARAGELI_FUNCTIONAL_PREFIX_NONMODIF_UNARY_GFUNC_BY_TAG(NAME, OPER)
#define ARAGELI_FUNCTIONAL_PREFIX_MODIF_UNARY_GFUNC_BY_TAG(NAME, OPER)
#define ARAGELI_FUNCTIONAL_POSTFIX_MODIF_UNARY_GFUNC_BY_TAG(NAME, OPER)
#define ARAGELI_FUNCTIONAL_BINARY_GFUNC_BY_TAG(NAME, OPER)

Functions

 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_plus, Arageli::left_assign_plus)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_minus, Arageli::left_assign_minus)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_multiplies, Arageli::left_assign_multiplies)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_divides, Arageli::left_assign_divides)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_modulus, Arageli::left_assign_modulus)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_bitwise_or, Arageli::left_assign_bitwise_or)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_bitwise_and, Arageli::left_assign_bitwise_and)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_bitwise_xor, Arageli::left_assign_bitwise_xor)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_shift_left, Arageli::left_assign_shift_left)
 Arageli::func::_ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 (left_assign_shift_right, Arageli::left_assign_shift_right)
template<typename Func>
swap_args< Func > Arageli::func::make_swap_args (const Func &func)


Detailed Description

For each function in Arageli this file declares class as a functor (?).

Definition in file functional.hpp.


Define Documentation

#define _ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_1 ( NAME,
OPER   ) 

Value:

template <typename Arg1, typename Arg2 = Arg1,              \
        typename Res = Arg1>                                    \
    struct NAME : public std::binary_function<Arg1, Arg2, Res>  \
    {                                                           \
        Res operator() (const Arg1& x, const Arg2& y) const     \
        { return OPER(x, y); }                                  \
                                                                \
        Res operator() (const Arg1& x, Arg2& y) const           \
        { return OPER(x, y); }                                  \
                                                                \
        Res operator() (Arg1& x, const Arg2& y) const           \
        { return OPER(x, y); }                                  \
                                                                \
        Res operator() (Arg1& x, Arg2& y) const                 \
        { return OPER(x, y); }                                  \
    };

Definition at line 148 of file functional.hpp.

#define _ARAGELI_BINARY_OPERATOR_FUNC_BUILDER_2 ( NAME,
OPER   ) 

Value:

template <typename Arg1, typename Arg2 = Arg1,              \
        typename Res = Arg1>                                    \
    struct NAME : public std::binary_function<Arg1, Arg2, Res>  \
    {                                                           \
        Res operator() (const Arg1& x, const Arg2& y) const     \
        { return x OPER y; }                                    \
                                                                \
        Res operator() (const Arg1& x, Arg2& y) const           \
        { return x OPER y; }                                    \
                                                                \
        Res operator() (Arg1& x, const Arg2& y) const           \
        { return x OPER y; }                                    \
                                                                \
        Res operator() (Arg1& x, Arg2& y) const                 \
        { return x OPER y; }                                    \
    };

Definition at line 166 of file functional.hpp.

#define _ARAGELI_FUNC_BUILDER_1 ( NAME,
RES   ) 

Value:

struct NAME                                 \
    {                                           \
        template <typename T>                   \
        RES operator() (const T& x) const       \
        { return Arageli::NAME(x); }            \
    };

Definition at line 348 of file functional.hpp.

#define _ARAGELI_FUNC_BUILDER_1 ( NAME,
RES   ) 

Value:

template <typename T>                                   \
    struct NAME : public std::unary_function<T, RES>        \
    {                                                       \
        RES operator() (const T& x) const                   \
        { return Arageli::NAME(x); }                        \
                                                            \
        RES operator() (T& x) const                         \
        { return Arageli::NAME(x); }                        \
    }

Definition at line 348 of file functional.hpp.

#define _ARAGELI_FUNC_BUILDER_2 ( NAME,
RES   ) 

Value:

struct NAME                                         \
    {                                                   \
        template <typename T1, typename T2>             \
        RES operator() (const T1& x, const T2& y) const \
        { return Arageli::NAME(x, y); }                 \
    };

Definition at line 356 of file functional.hpp.

#define _ARAGELI_UNARY_OPERATOR_FUNC_BUILDER_1 ( NAME,
OPER   ) 

Value:

template <typename Arg, typename Res = Arg>             \
    struct NAME : public std::unary_function<Arg, Res>      \
    {                                                       \
        Res operator() (const Arg& x) const                 \
        { return OPER x; }                                  \
                                                            \
        Res operator() (Arg& x) const                       \
        { return OPER x; }                                  \
    };

Definition at line 106 of file functional.hpp.

#define ARAGELI_FUNCTIONAL_BINARY_GFUNC_BY_TAG ( NAME,
OPER   ) 

Value:

template<> struct by_tag<function_tag::NAME>            \
    {                                                       \
        template <typename T1, typename T2>                 \
            typename binary_function_traits                 \
                <function_tag::NAME, const T1&, const T2&>::result_type \
        operator() (const T1& x, const T2& y) const         \
        { return x OPER y; }                                \
    };

Definition at line 417 of file functional.hpp.

#define ARAGELI_FUNCTIONAL_POSTFIX_MODIF_UNARY_GFUNC_BY_TAG ( NAME,
OPER   ) 

Value:

template<> struct by_tag<function_tag::NAME>        \
    {                                                   \
        template <typename T1>                          \
            typename unary_function_traits              \
                <function_tag::NAME, T1>::result_type   \
        operator() (T1& x) const                        \
        { return x OPER; }                              \
    };

Definition at line 402 of file functional.hpp.

#define ARAGELI_FUNCTIONAL_PREFIX_MODIF_UNARY_GFUNC_BY_TAG ( NAME,
OPER   ) 

Value:

template<> struct by_tag<function_tag::NAME>        \
    {                                                   \
        template <typename T1>                          \
            typename unary_function_traits              \
                <function_tag::NAME, T1>::result_type   \
        operator() (T1& x) const                        \
        { return OPER x; }                              \
    };

Definition at line 387 of file functional.hpp.

#define ARAGELI_FUNCTIONAL_PREFIX_NONMODIF_UNARY_GFUNC_BY_TAG ( NAME,
OPER   ) 

Value:

template<> struct by_tag<function_tag::NAME>        \
    {                                                   \
        template <typename T1>                          \
            typename unary_function_traits              \
                <function_tag::NAME, T1>::result_type   \
        operator() (const T1& x) const                  \
        { return OPER x; }                              \
    };

Definition at line 369 of file functional.hpp.


Generated on Thu Aug 31 17:38:17 2006 for Arageli by  doxygen 1.4.7