Alexandria 2.32.0
SDC-CH common library for the Euclid project
|
#include <AttributeSet.h>
Classes | |
struct | AttrGetterFactory |
Public Member Functions | |
Placeholder (const unsigned pos, const AttributeSet &attrs) | |
boost::python::object | get (const std::string &name) const |
std::string | repr () const final |
AttributeSet | eval (const Context &, const Arguments &args) const final |
void | visit (Visitor &visitor) const final |
Public Member Functions inherited from Pyston::Node< T > | |
Node () | |
virtual | ~Node ()=default |
template<typename... Args> | |
T | eval (const Context &context, Args... args) const |
template<typename... Args> | |
T | eval (Args... args) const |
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 | |
unsigned | m_pos |
AttributeSet | m_attrs |
Additional Inherited Members | |
Protected Member Functions inherited from Pyston::Node< T > | |
T | eval_helper (const Context &context, Arguments &arguments) const |
template<typename A0, typename... AN> | |
T | eval_helper (const Context &context, Arguments &arguments, A0 v0, AN... an) const |
Specialization of Placeholder for object-like variables. Note that, unlike other placeholders, this is used only during the evaluation. The final tree uses AttrGetter instances
Definition at line 85 of file AttributeSet.h.
|
inline |
Constructor
name | Name of the Placeholder. It will be used to retrieve later the value assigned to it. |
attrs | Acceptable attribute names, with an instance of the acceptable type |
Definition at line 94 of file AttributeSet.h.
|
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.
std::out_of_range | There is no value assigned to this placeholder |
boost::bad_get | The type of the value assigned to the placeholder does not correspond to the expected type T |
Implements Pyston::Node< T >.
Definition at line 56 of file Placeholder.h.
|
inline |
Unfortunately we have to return directly a python object wrapping the appropiate AttrGetter
name | Parameter name |
UnrecoverableError | If the name is not a known parameter. Fallback to Python interpretation will not help. |
It uses a boost visitor to generate the right AttrGetter depending on the value stored on the prototype object passed to the constructor
Definition at line 107 of file AttributeSet.h.
|
inlinefinalvirtual |
Implements Pyston::NodeBase.
Definition at line 44 of file Placeholder.h.
|
inlinefinalvirtual |
Entry point for the visitor
Implements Pyston::NodeBase.
Definition at line 63 of file Placeholder.h.
|
private |
Definition at line 115 of file AttributeSet.h.
Referenced by get(), and Placeholder().
|
private |
Definition at line 114 of file AttributeSet.h.
Referenced by get(), and Placeholder().