Cerata
A library to generate structural hardware designs
|
An array of signal nodes. More...
#include <array.h>
Public Member Functions | |
SignalArray (const std::shared_ptr< Signal > &base, const std::shared_ptr< Node > &size) | |
SignalArray constructor. | |
![]() | |
Node::NodeID | node_id () |
Return the type ID of the nodes in this NodeArray. | |
NodeArray (std::string name, Node::NodeID id, std::shared_ptr< Node > base, const std::shared_ptr< Node > &size) | |
ArrayNode constructor. | |
void | SetParent (Graph *new_parent) override |
Set the parent of this NodeArray base node and array nodes. | |
Node * | size () const |
Return the size node. | |
void | SetSize (const std::shared_ptr< Node > &size) |
Set the size node. | |
void | SetType (const std::shared_ptr< Type > &type) |
Set the type of the base node and array nodes. | |
Type * | type () const |
Return the type of the nodes in the NodeArray. | |
std::shared_ptr< Object > | Copy () const override |
Deep-copy the NodeArray, but not the array nodes. Resets the size node to an integer literal of 0. | |
NodeArray * | CopyOnto (Graph *dst, const std::string &name, NodeMap *rebinding) |
Copy the NodeArray onto a graph, but not the array nodes. Creates a new size node set to zero. | |
std::shared_ptr< Node > | Append (bool increment_size=true) |
Append a node to this array, optionally incrementing the size node. Returns a pointer to that node. | |
std::vector< Node * > | nodes () const |
Return all nodes of this NodeArray. | |
Node * | node (size_t i) const |
Return element node i. | |
Node * | operator[] (size_t i) const |
Return element node i. | |
size_t | num_nodes () const |
Return the number of element nodes. | |
size_t | IndexOf (const Node &n) const |
Return the index of a specific node. | |
std::string | ToString () const |
Return a human-readable representation of this NodeArray. | |
std::shared_ptr< Node > | base () const |
Return the base node of this NodeArray. | |
void | AppendReferences (std::vector< Object * > *out) const override |
Append all objects that this object owns to the output. | |
![]() | |
Object (std::string name, ID id) | |
Cerata object constructor. More... | |
ID | obj_id () const |
Return the object ID of this object. | |
bool | IsNode () const |
Return true if this object is a node. | |
bool | IsArray () const |
Return true if this object is an array. | |
virtual std::optional< Graph * > | parent () const |
Return the parent graph of this object, if any. Returns empty option otherwise. | |
![]() | |
Named (std::string name) | |
Named constructor. | |
std::string | name () const |
Return the name of the object. | |
void | SetName (std::string name) |
Change the name of the object. | |
virtual | ~Named ()=default |
Destructor. | |
Additional Inherited Members | |
![]() | |
enum | ID { NODE, ARRAY } |
Object type ID to conveniently cast the object during run-time. More... | |
![]() | |
std::unordered_map< std::string, std::string > | meta |
KV storage for metadata of tools or specific backend implementations. | |
![]() | |
void | IncrementSize () |
Increment the size of the ArrayNode. | |
![]() | |
Node::NodeID | node_id_ |
The type ID of the nodes in this NodeArray. | |
std::shared_ptr< Node > | base_ |
A node representing the template for each of the element nodes. | |
std::shared_ptr< Node > | size_ |
A node representing the number of concatenated edges. | |
std::vector< std::shared_ptr< Node > > | nodes_ |
The nodes contained by this array. | |
![]() | |
ID | obj_id_ |
The object type ID. | |
std::optional< Graph * > | parent_ = {} |
An optional parent Graph to which this Object belongs. Initially no value. | |