Alexandria 2.32.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Pyston::Node< T > Class Template Referenceabstract

#include <Node.h>

Inheritance diagram for Pyston::Node< T >:
Collaboration diagram for Pyston::Node< T >:

Public Member Functions

 Node ()
virtual ~Node ()=default
virtual T eval (const Context &, const Arguments &) const =0
template<typename... Args>
eval (const Context &context, Args... args) const
template<typename... Args>
eval (Args... args) const
Public Member Functions inherited from Pyston::NodeBase
 NodeBase (const std::type_index &type_index)
virtual ~NodeBase ()=default
virtual std::string repr () const =0
virtual void visit (Visitor &) const =0
const std::type_indextype () const

Protected Member Functions

eval_helper (const Context &context, Arguments &arguments) const
template<typename A0, typename... AN>
eval_helper (const Context &context, Arguments &arguments, A0 v0, AN... an) const

Detailed Description

template<typename T>
class Pyston::Node< T >

A node on the computing tree, which has an associated primitive type

Definition at line 105 of file Node.h.

Constructor & Destructor Documentation

◆ Node()

template<typename T>
Pyston::Node< T >::Node ( )
inline

Constructor

Definition at line 110 of file Node.h.

References Pyston::NodeBase::NodeBase().

Here is the call graph for this function:

◆ ~Node()

template<typename T>
virtual Pyston::Node< T >::~Node ( )
virtualdefault

Destructor

Member Function Documentation

◆ eval() [1/3]

template<typename T>
template<typename... Args>
T Pyston::Node< T >::eval ( Args... args) const
inline

Definition at line 138 of file Node.h.

References eval().

Here is the call graph for this function:

◆ eval() [2/3]

template<typename T>
virtual T Pyston::Node< T >::eval ( const Context & ,
const Arguments &  ) const
pure virtual

Evaluate the computing tree

In principle one could avoid to pass any values here, and assign directly the final value to the placeholders that were used to create this tree. However, this would cause the placeholders not to be thread-safe, and a tree would have to be either cloned, either protected by a mutex. Passing the values as an argument allows making the full tree immutable once built, and fully thread safe.

Returns
Result of the evaluation

Implemented in Pyston::AttrGetter< T >, Pyston::Cast< To, From >, Pyston::Constant< T >, Pyston::Function< R, Args >, Pyston::Placeholder< T >, Pyston::Placeholder< AttributeSet >, and Pyston::PythonCall< T >.

Referenced by eval(), and eval_helper().

◆ eval() [3/3]

template<typename T>
template<typename... Args>
T Pyston::Node< T >::eval ( const Context & context,
Args... args ) const
inline

Definition at line 132 of file Node.h.

References eval_helper().

Here is the call graph for this function:

◆ eval_helper() [1/2]

template<typename T>
T Pyston::Node< T >::eval_helper ( const Context & context,
Arguments & arguments ) const
inlineprotected

Definition at line 143 of file Node.h.

References eval().

Referenced by eval(), and eval_helper().

Here is the call graph for this function:

◆ eval_helper() [2/2]

template<typename T>
template<typename A0, typename... AN>
T Pyston::Node< T >::eval_helper ( const Context & context,
Arguments & arguments,
A0 v0,
AN... an ) const
inlineprotected

Definition at line 148 of file Node.h.

References eval_helper(), and std::vector< T >::push_back().

Here is the call graph for this function:

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