Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Pyston::FunctionFactory< R(Args...)> Class Template Reference

#include <Function.h>

Collaboration diagram for Pyston::FunctionFactory< R(Args...)>:
Collaboration graph
[legend]

Public Member Functions

 FunctionFactory (const std::string &repr, std::function< R(const Context &, Args...)> functor)
 
std::shared_ptr< Node< R > > operator() (const std::shared_ptr< Node< Args > > &... nodes) const
 

Protected Attributes

std::string m_repr
 
std::function< R(const Context &, Args...)> m_functor
 

Detailed Description

template<typename R, typename... Args>
class Pyston::FunctionFactory< R(Args...)>

Specialization for functions that receive a context

Template Parameters
RType corresponding to the created new Node
TType corresponding to the received Node

Definition at line 91 of file Function.h.

Constructor & Destructor Documentation

◆ FunctionFactory()

template<typename R , typename... Args>
Pyston::FunctionFactory< R(Args...)>::FunctionFactory ( const std::string repr,
std::function< R(const Context &, Args...)>  functor 
)
inline

Constructor

Parameters
functorThe functor that will be passed down to the created UnaryOperator nodes
reprHuman readable representation of the operator

Definition at line 100 of file Function.h.

Member Function Documentation

◆ operator()()

template<typename R , typename... Args>
std::shared_ptr< Node< R > > Pyston::FunctionFactory< R(Args...)>::operator() ( const std::shared_ptr< Node< Args > > &...  nodes) const
inline

Callable that creates the Node

This is what gets called from Python when an operator is used. For instance -a will trigger a call factory(a). Unlike the BinaryOperatorFactory, this will not be called is a is not of type Node, since there would be no reason to!

Definition at line 110 of file Function.h.

References std::make_shared().

Here is the call graph for this function:

Member Data Documentation

◆ m_functor

template<typename R , typename... Args>
std::function<R(const Context&, Args...)> Pyston::FunctionFactory< R(Args...)>::m_functor
protected

Definition at line 116 of file Function.h.

◆ m_repr

template<typename R , typename... Args>
std::string Pyston::FunctionFactory< R(Args...)>::m_repr
protected

Definition at line 115 of file Function.h.


The documentation for this class was generated from the following file: