Alexandria  2.25.0
SDC-CH common library for the Euclid project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
Pyston::Node< T > Class Template Referenceabstract

#include <Node.h>

Inheritance diagram for Pyston::Node< T >:
Inheritance graph
[legend]
Collaboration diagram for Pyston::Node< T >:
Collaboration graph
[legend]

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

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

Constructor

Definition at line 110 of file Node.h.

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

Destructor

Member Function Documentation

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::Function< R, Args >, Pyston::AttrGetter< T >, Pyston::Cast< To, From >, Pyston::Placeholder< T >, Pyston::Constant< T >, and Pyston::PythonCall< T >.

Referenced by Pyston::Node< To >::eval(), and Pyston::Node< To >::eval_helper().

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.

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

Definition at line 138 of file Node.h.

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

Definition at line 143 of file Node.h.

Referenced by Pyston::Node< To >::eval(), and Pyston::Node< To >::eval_helper().

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.


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