Alexandria
2.27.0
SDC-CH common library for the Euclid project
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Pyston
Pyston
Graph
Constant.h
Go to the documentation of this file.
1
19
#ifndef PYSTON_CONSTANT_H
20
#define PYSTON_CONSTANT_H
21
22
#include "
Node.h
"
23
24
namespace
Pyston {
25
31
template
<
typename
T>
32
class
Constant
:
public
Node
<T> {
33
public
:
39
explicit
Constant
(T value) :
m_value
{value} {}
40
44
std::string
repr
() const final {
45
return
std::to_string
(
m_value
);
46
}
47
53
T
eval
(
const
Context
&,
const
Arguments
&) const final {
54
return
m_value
;
55
}
56
60
void
visit
(
Visitor
& visitor)
const
final
{
61
visitor.enter(
this
);
62
visitor.exit(
this
);
63
}
64
65
private
:
66
T
m_value
;
67
};
68
69
}
// end of namespace Pyston
70
71
#endif // PYSTON_CONSTANT_H
Pyston::Visitor
Definition:
Node.h:160
Node.h
std::to_string
T to_string(T...args)
Pyston::Constant::Constant
Constant(T value)
Definition:
Constant.h:39
std::map
STL class.
Pyston::Constant::repr
std::string repr() const final
Definition:
Constant.h:44
std::string
STL class.
Pyston::Constant::visit
void visit(Visitor &visitor) const final
Definition:
Constant.h:60
Pyston::Constant::m_value
T m_value
Definition:
Constant.h:66
std::vector
STL class.
Pyston::Node
Definition:
Node.h:105
Pyston::Constant::eval
T eval(const Context &, const Arguments &) const final
Definition:
Constant.h:53
Pyston::Constant
Definition:
Constant.h:32
Generated by
1.8.5