Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
#include <Cast.h>
Public Member Functions | |
Cast (const std::shared_ptr< Node< From > > &node) | |
std::string | repr () const final |
To | eval (const Context &context, const Arguments &args) const final |
void | visit (Visitor &visitor) const final |
![]() | |
Node () | |
virtual | ~Node ()=default |
To | eval (const Context &context, Args... args) const |
To | eval (Args... args) const |
![]() | |
NodeBase (const std::type_index &type_index) | |
virtual | ~NodeBase ()=default |
const std::type_index & | type () const |
Private Attributes | |
std::shared_ptr< Node< From > > | m_node |
Additional Inherited Members | |
![]() | |
To | eval_helper (const Context &context, Arguments &arguments) const |
To | eval_helper (const Context &context, Arguments &arguments, A0 v0, AN... an) const |
Node type that casts one type of value into another. This is required so we can, for instance, add a boolean to a float.
To | Cast type |
From | Casted type |
|
inlineexplicit |
|
inlinefinalvirtual |
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.
Implements Pyston::Node< To >.
Definition at line 61 of file Cast.h.
References Pyston::Cast< To, From >::m_node.
|
inlinefinalvirtual |
Implements Pyston::NodeBase.
|
inlinefinalvirtual |
Entry point for the visitor
Implements Pyston::NodeBase.
Definition at line 68 of file Cast.h.
References Pyston::Cast< To, From >::m_node.
|
private |
Definition at line 75 of file Cast.h.
Referenced by Pyston::Cast< To, From >::eval(), and Pyston::Cast< To, From >::visit().