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

An array of port nodes. More...

#include <array.h>

+ Inheritance diagram for cerata::PortArray:
+ Collaboration diagram for cerata::PortArray:

Public Member Functions

 PortArray (const std::shared_ptr< Port > &base, const std::shared_ptr< Node > &size)
 Construct a new port array.
 
std::shared_ptr< ObjectCopy () const override
 Make a copy of this port array.
 
- 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.
 
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.
 
- Public Member Functions inherited from cerata::Term
Dir dir () const
 Return the direction of this terminator.
 
 Term (Dir dir)
 Construct a new Term.
 
bool IsInput ()
 Return true if this Term is an input, false otherwise.
 
bool IsOutput ()
 Return true if this Term is an output, false otherwise.
 

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 Types inherited from cerata::Term
enum  Dir { IN, OUT }
 Terminator direction.
 
- Static Public Member Functions inherited from cerata::Term
static Dir Reverse (Dir dir)
 Return the inverse of a direction.
 
static std::string str (Dir dir)
 Convert a Dir to a human-readable string.
 
- 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.
 
- Protected Attributes inherited from cerata::Term
Dir dir_
 The direction of this terminator.
 

Detailed Description

An array of port nodes.

Definition at line 123 of file array.h.


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