Cerata
A library to generate structural hardware designs
cerata::SignalArray Class Reference

An array of signal nodes. More...

#include <array.h>

+ Inheritance diagram for cerata::SignalArray:
+ Collaboration diagram for cerata::SignalArray:

Public Member Functions

 SignalArray (const std::shared_ptr< Signal > &base, const std::shared_ptr< Node > &size)
 SignalArray constructor.
 
- Public Member Functions inherited from cerata::NodeArray
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.
 
Nodesize () 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.
 
Typetype () const
 Return the type of the nodes in the NodeArray.
 
std::shared_ptr< ObjectCopy () const override
 Deep-copy the NodeArray, but not the array nodes. Resets the size node to an integer literal of 0.
 
NodeArrayCopyOnto (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< NodeAppend (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.
 
Nodenode (size_t i) const
 Return element node i.
 
Nodeoperator[] (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< Nodebase () 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.
 
- Public Member Functions inherited from cerata::Object
 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.
 
- Public Member Functions inherited from cerata::Named
 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

- Public Types inherited from cerata::Object
enum  ID { NODE, ARRAY }
 Object type ID to conveniently cast the object during run-time. More...
 
- Public Attributes inherited from cerata::Object
std::unordered_map< std::string, std::string > meta
 KV storage for metadata of tools or specific backend implementations.
 
- Protected Member Functions inherited from cerata::NodeArray
void IncrementSize ()
 Increment the size of the ArrayNode.
 
- Protected Attributes inherited from cerata::NodeArray
Node::NodeID node_id_
 The type ID of the nodes in this NodeArray.
 
std::shared_ptr< Nodebase_
 A node representing the template for each of the element nodes.
 
std::shared_ptr< Nodesize_
 A node representing the number of concatenated edges.
 
std::vector< std::shared_ptr< Node > > nodes_
 The nodes contained by this array.
 
- Protected Attributes inherited from cerata::Object
ID obj_id_
 The object type ID.
 
std::optional< Graph * > parent_ = {}
 An optional parent Graph to which this Object belongs. Initially no value.
 

Detailed Description

An array of signal nodes.

Definition at line 100 of file array.h.


The documentation for this class was generated from the following file: