 |
Cerata
A library to generate structural hardware designs
|
21 #include <unordered_map>
23 #include "cerata/utils.h"
59 virtual std::optional<Graph *>
parent()
const;
61 virtual std::shared_ptr<Object>
Copy()
const = 0;
67 std::unordered_map<std::string, std::string>
meta;
std::unordered_map< std::string, std::string > meta
KV storage for metadata of tools or specific backend implementations.
bool IsNode() const
Return true if this object is a node.
ID
Object type ID to conveniently cast the object during run-time.
A graph representing a hardware structure.
ID obj_id_
The object type ID.
virtual void SetParent(Graph *parent)
Set the parent graph of this object.
Contains every Cerata class, function, etc...
bool IsArray() const
Return true if this object is an array.
virtual std::shared_ptr< Object > Copy() const =0
Deep-copy the object.
Object(std::string name, ID id)
Cerata object constructor.
std::string name() const
Return the name of the object.
A Cerata Object on a graph.
Convenience structure for anything that is named. Names are case-sensitive.
virtual void AppendReferences(std::vector< Object * > *out) const =0
Append all objects that this object owns to the output.
std::optional< Graph * > parent_
An optional parent Graph to which this Object belongs. Initially no value.
ID obj_id() const
Return the object ID of this object.
virtual std::optional< Graph * > parent() const
Return the parent graph of this object, if any. Returns empty option otherwise.