Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
#include <ExpressionTreeBuilder.h>
Classes | |
struct | buildHelper |
struct | buildHelper< R(Args...)> |
struct | buildHelper< R(const std::vector< T > &)> |
Public Member Functions | |
template<typename Signature , typename... BuildParams> | |
ExpressionTree< Signature > | build (const boost::python::object &pyfunc, BuildParams &&... build_params) const |
template<typename Signature > | |
void | registerFunction (const std::string &repr, std::function< Signature > functor) |
Static Private Member Functions | |
template<typename R , typename... Args> | |
static ExpressionTree< R(Args...)> | compiledOrWrapped (const boost::python::object &pyfunc, const boost::python::list &placeholders) |
Builds an expression tree from a Python function, given its signature. If it is not possible to do so (for instance, due to the use of branching conditional on some placeholder), it will wrap the Python function in a compatible manner
Definition at line 43 of file ExpressionTreeBuilder.h.
|
inline |
Build an expression tree, or wrap the Python function in a compatible manner
Signature | Function signature (i.e. double(double,double)) |
pyfunc | Python object pointing to a callable. Its signature must match the template. |
build_params | Required build parameters: either prototypes for AttributeSet, if any is passed along, or the number of elements for functions with variable number of parameters |
true
if an expression tree could be built, false otherwise. The second value is the wrapping functor. Definition at line 59 of file ExpressionTreeBuilder.h.
|
staticprivate |
Common to buildHelper specializations
void Pyston::ExpressionTreeBuilder::registerFunction | ( | const std::string & | repr, |
std::function< Signature > | functor | ||
) |
Register a function
Signature | Function signature |
repr | Function name |
Referenced by Example::mainMethod().