Alexandria 2.31.4
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 |
Public Member Functions inherited from Pyston::Node< To > | |
Node () | |
virtual | ~Node ()=default |
Public Member Functions inherited from Pyston::NodeBase | |
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 | |
Protected Member Functions inherited from Pyston::Node< To > | |
To | eval_helper (const Context &context, Arguments &arguments) 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 |
Constructor
node | Wrapped node, for which its eval result will be casted to To |
Definition at line 49 of file Cast.h.
References m_node, and Pyston::Node< To >::Node().
|
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 m_node.
|
inlinefinalvirtual |
Implements Pyston::NodeBase.
|
inlinefinalvirtual |
Entry point for the visitor
Implements Pyston::NodeBase.
Definition at line 68 of file Cast.h.
References m_node.
|
private |