ra4_draw  4bd0201e3d922d42bd545d4b045ed44db33454a4
Namespaces | Typedefs | Functions
named_func.cpp File Reference
#include "core/named_func.hpp"
#include <iostream>
#include <utility>
#include "core/utilities.hpp"
#include "core/function_parser.hpp"

Go to the source code of this file.

Namespaces

 anonymous_namespace{named_func.cpp}
 

Typedefs

using ScalarType = NamedFunc::ScalarType
 
using VectorType = NamedFunc::VectorType
 
using ScalarFunc = NamedFunc::ScalarFunc
 
using VectorFunc = NamedFunc::VectorFunc
 

Functions

template<typename Operator >
function< ScalarFuncanonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &f, const Operator &op)
 Get a functor applying unary operator op to f. More...
 
template<typename Operator >
function< VectorFuncanonymous_namespace{named_func.cpp}::ApplyOp (const function< VectorFunc > &f, const Operator &op)
 Get a functor applying unary operator op to f. More...
 
template<typename Operator >
pair< function< ScalarFunc >, function< VectorFunc > > anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &sfa, const function< VectorFunc > &vfa, const function< ScalarFunc > &sfb, const function< VectorFunc > &vfb, const Operator &op)
 Get a functor applying binary operator op to operands (sfa or vfa) and (sfb or vfb) More...
 
template<>
pair< function< ScalarFunc >, function< VectorFunc > > anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &sfa, const function< VectorFunc > &vfa, const function< ScalarFunc > &sfb, const function< VectorFunc > &vfb, const logical_and< ScalarType > &)
 Get a functor applying binary "&&" to operands (sfa or vfa) and (sfb or vfb) More...
 
template<>
pair< function< ScalarFunc >, function< VectorFunc > > anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &sfa, const function< VectorFunc > &vfa, const function< ScalarFunc > &sfb, const function< VectorFunc > &vfb, const logical_or< ScalarType > &)
 Get a functor applying binary "||" to operands (sfa or vfa) and (sfb or vfb) More...
 
NamedFunc operator+ (NamedFunc f, NamedFunc g)
 Add two NamedFuncs. More...
 
NamedFunc operator- (NamedFunc f, NamedFunc g)
 Add a NamedFunc from another. More...
 
NamedFunc operator* (NamedFunc f, NamedFunc g)
 Multiply two NamedFuncs. More...
 
NamedFunc operator/ (NamedFunc f, NamedFunc g)
 Divide two NamedFuncs. More...
 
NamedFunc operator% (NamedFunc f, NamedFunc g)
 Get remainder form division of two NamedFuncs. More...
 
NamedFunc operator+ (NamedFunc f)
 Applied unary plus operator. Acts as identity operation. More...
 
NamedFunc operator- (NamedFunc f)
 Negates f. More...
 
NamedFunc operator== (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests for equality of results of f and g. More...
 
NamedFunc operator!= (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests for inequality of results of f and g. More...
 
NamedFunc operator> (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests if result of f is greater than result of g. More...
 
NamedFunc operator< (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests if result of f is less than result of g. More...
 
NamedFunc operator>= (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests if result of f is greater than or equal to result of g. More...
 
NamedFunc operator<= (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests if result of f is less than or equal to result of g. More...
 
NamedFunc operator&& (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests if results of both f and g are true. More...
 
NamedFunc operator|| (NamedFunc f, NamedFunc g)
 Gets NamedFunc which tests if result of f or g is true. More...
 
NamedFunc operator! (NamedFunc f)
 Gets NamedFunct returning logical inverse of result of f. More...
 
ostream & operator<< (ostream &stream, const NamedFunc &function)
 Print NamedFunc to output stream. More...
 
bool HavePass (const NamedFunc::VectorType &v)
 
bool HavePass (const std::vector< NamedFunc::VectorType > &vv)
 

Typedef Documentation

Definition at line 56 of file named_func.cpp.

Definition at line 54 of file named_func.cpp.

Definition at line 57 of file named_func.cpp.

Definition at line 55 of file named_func.cpp.

Function Documentation

bool HavePass ( const NamedFunc::VectorType v)
bool HavePass ( const std::vector< NamedFunc::VectorType > &  vv)

Definition at line 837 of file named_func.cpp.

NamedFunc operator! ( NamedFunc  f)

Gets NamedFunct returning logical inverse of result of f.

Parameters
[in]fFunction whose result the logical not is applied to
Returns
NamedFunc returning logical inverse of result of f

Definition at line 812 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

Gets NamedFunc which tests for inequality of results of f and g.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f and g are not equal

Definition at line 683 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator% ( NamedFunc  f,
NamedFunc  g 
)

Get remainder form division of two NamedFuncs.

Parameters
[in]fDividend
[in]gDivisor
Returns
NamedFunc which returns the remainder from dividing the results of f and g

Definition at line 629 of file named_func.cpp.

NamedFunc operator&& ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests if results of both f and g are true.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of both f and g are true

Definition at line 778 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator* ( NamedFunc  f,
NamedFunc  g 
)

Multiply two NamedFuncs.

Parameters
[in]fMultiplier
[in]gMultiplicand
Returns
NamedFunc which returns the product of the results of f and g

Definition at line 604 of file named_func.cpp.

NamedFunc operator+ ( NamedFunc  f,
NamedFunc  g 
)

Add two NamedFuncs.

Parameters
[in]fAugend
[in]gAddend
Returns
NamedFunc which returns the sum of the results of f and g

Definition at line 580 of file named_func.cpp.

NamedFunc operator+ ( NamedFunc  f)

Applied unary plus operator. Acts as identity operation.

Parameters
[in]fNamedFunc to apply unary "+" to
Returns
f

Definition at line 639 of file named_func.cpp.

References NamedFunc::Name().

NamedFunc operator- ( NamedFunc  f,
NamedFunc  g 
)

Add a NamedFunc from another.

Parameters
[in]fMinuend
[in]gSubtrahend
Returns
NamedFunc which returns the difference of the results of f and g

Definition at line 592 of file named_func.cpp.

NamedFunc operator- ( NamedFunc  f)

Negates f.

Parameters
[in]fNamedFunc to apply unary "-" to
Returns
NamedFunc returing the negative of the result of f

Definition at line 650 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator/ ( NamedFunc  f,
NamedFunc  g 
)

Divide two NamedFuncs.

Parameters
[in]fDividend
[in]gDivisor
Returns
NamedFunc which returns the quotient of the results of f and g

Definition at line 616 of file named_func.cpp.

NamedFunc operator< ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests if result of f is less than result of g.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f is less than result of g

Definition at line 720 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

ostream& operator<< ( ostream &  stream,
const NamedFunc function 
)

Print NamedFunc to output stream.

Parameters
[in,out]streamOutput stream to print to
[in]functionNamedFunc to print

Definition at line 825 of file named_func.cpp.

NamedFunc operator<= ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests if result of f is less than or equal to result of g.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f is less than or equal to result of g

Definition at line 760 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator== ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests for equality of results of f and g.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f and g are equal

Definition at line 665 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator> ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests if result of f is greater than result of g.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f is greater than result of g

Definition at line 702 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator>= ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests if result of f is greater than or equal to result of g.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f is greater than or equal to result of g

Definition at line 740 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().

NamedFunc operator|| ( NamedFunc  f,
NamedFunc  g 
)

Gets NamedFunc which tests if result of f or g is true.

Parameters
[in]fLeft hand operand
[in]gRight hand operand
Returns
NamedFunc returning whether the results of f or g is true

Definition at line 796 of file named_func.cpp.

References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().