 |
Cerata
A library to generate structural hardware designs
|
21 #include "cerata/node.h"
34 std::shared_ptr<Object>
Copy()
const override;
63 std::shared_ptr<Parameter>
parameter(
const std::string &name,
64 const std::shared_ptr<Type> &type,
65 std::shared_ptr<Literal> default_value =
nullptr);
68 std::shared_ptr<Parameter>
parameter(
const std::string &name,
int default_value);
71 std::shared_ptr<Parameter>
parameter(
const std::string &name);
74 std::shared_ptr<Parameter>
parameter(
const std::string &name,
bool default_value);
77 std::shared_ptr<Parameter>
parameter(
const std::string &name, std::string default_value);
void TraceValue(std::vector< Node * > *trace)
Append this node and nodes that source this node's value, until an expression or literal is encounter...
Node * value() const
Return the value node.
std::optional< NodeArray * > node_array_parent
If this parametrizes a node array, this stores a pointer to the NodeArray.
Contains every Cerata class, function, etc...
std::shared_ptr< Literal > default_value_
Parameter value.
Parameter * SetValue(const std::shared_ptr< Node > &value)
Set the value of the parameter node. Can only be expression, parameter, or literal.
std::string name() const
Return the name of the object.
Parameter(std::string name, const std::shared_ptr< Type > &type, std::shared_ptr< Literal > default_value)
Construct a new Parameter, optionally defining a default value Literal.
A single-input, multiple-outputs node.
std::shared_ptr< Object > Copy() const override
Create a copy of this Parameter.
Literal * default_value()
Return the default value node.
std::shared_ptr< Parameter > parameter(const std::string &name, const std::shared_ptr< Type > &type, std::shared_ptr< Literal > default_value)
Create a new parameter.
Type * type() const
Return the node Type.