Cerata
A library to generate structural hardware designs
cerata::Object Class Referenceabstract

A Cerata Object on a graph. More...

#include <object.h>

+ Inheritance diagram for cerata::Object:
+ Collaboration diagram for cerata::Object:

Public Types

enum  ID { NODE, ARRAY }
 Object type ID to conveniently cast the object during run-time. More...
 

Public Member Functions

 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 void SetParent (Graph *parent)
 Set the parent graph of this object.
 
virtual std::optional< Graph * > parent () const
 Return the parent graph of this object, if any. Returns empty option otherwise.
 
virtual std::shared_ptr< ObjectCopy () const =0
 Deep-copy the object.
 
virtual void AppendReferences (std::vector< Object * > *out) const =0
 Append all objects that this object owns to the output.
 
- 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 Attributes

std::unordered_map< std::string, std::string > meta
 KV storage for metadata of tools or specific backend implementations.
 

Protected Attributes

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

A Cerata Object on a graph.

Definition at line 34 of file object.h.

Member Enumeration Documentation

◆ ID

Object type ID to conveniently cast the object during run-time.

Enumerator
NODE 

Node object.

ARRAY 

Array object.

Definition at line 37 of file object.h.

Constructor & Destructor Documentation

◆ Object()

cerata::Object::Object ( std::string  name,
ID  id 
)
inlineexplicit

Cerata object constructor.

Parameters
nameThe name of the object.
idThe type ID of the object.

Definition at line 47 of file object.h.


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