ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::dumper::dot::Node Class Reference

Class that represents a Node in "dot" format. More...

#include <Node.h>

Public Member Functions

virtual ~Node ()=default
 Destroy the Node object.
 
 Node (const std::string &id)
 Construct a new Node object.
 
std::string id () const
 return id
 
const std::unordered_map< std::string, std::string > & attributes () const
 return attributes
 
void setAttribute (const std::string &key, const std::string &val)
 Store an attribute with key-value pair.
 
std::string getAttribute (const std::string &key)
 Get the attributte value that is associated with key.
 
void addOutEdge (Node *dotinfo)
 Add an edge in the graph, which is an outgoing edge.
 
const std::vector< Node * > & out_edges () const
 Return list of out edges.
 

Static Public Attributes

static const std::string DEFAULT_FILLCOLOR = "x11"
 
static const std::string DEFAULT_COLORSCHEME = "white"
 
static const std::string BG_COLORS [8] = {"1", "2", "3", "4", "5", "6", "7", "8"}
 

Detailed Description

Class that represents a Node in "dot" format.

Definition at line 51 of file Node.h.

Constructor & Destructor Documentation

◆ ~Node()

virtual onert::dumper::dot::Node::~Node ( )
virtualdefault

Destroy the Node object.

◆ Node()

onert::dumper::dot::Node::Node ( const std::string &  id)

Construct a new Node object.

Parameters
id

Definition at line 22 of file Node.cc.

22 : _id{id}
23{
24 // Set default values
25 _attributes["style"] = "filled";
26 _attributes["colorscheme"] = DEFAULT_COLORSCHEME;
27 _attributes["fillcolor"] = DEFAULT_FILLCOLOR;
28}
static const std::string DEFAULT_COLORSCHEME
Definition Node.h:55
static const std::string DEFAULT_FILLCOLOR
Definition Node.h:54

References DEFAULT_COLORSCHEME, and DEFAULT_FILLCOLOR.

Member Function Documentation

◆ addOutEdge()

void onert::dumper::dot::Node::addOutEdge ( Node dotinfo)
inline

Add an edge in the graph, which is an outgoing edge.

Parameters
[in]dotinfoA node that the new edge will be connected to

Definition at line 106 of file Node.h.

106{ _out_edges.emplace_back(dotinfo); }

◆ attributes()

const std::unordered_map< std::string, std::string > & onert::dumper::dot::Node::attributes ( ) const
inline

return attributes

Returns
const reference of attributes object

Definition at line 85 of file Node.h.

85{ return _attributes; }

◆ getAttribute()

std::string onert::dumper::dot::Node::getAttribute ( const std::string &  key)

Get the attributte value that is associated with key.

Parameters
[in]keykey of the attribute
Returns
value that is associated with the key

Definition at line 32 of file Node.cc.

33{
34 auto itr = _attributes.find(key);
35 if (itr == _attributes.end())
36 {
37 return "";
38 }
39 else
40 {
41 return itr->second;
42 }
43}

◆ id()

std::string onert::dumper::dot::Node::id ( ) const
inline

return id

Returns
id

Definition at line 78 of file Node.h.

78{ return _id; }

◆ out_edges()

const std::vector< Node * > & onert::dumper::dot::Node::out_edges ( ) const
inline

Return list of out edges.

Returns
Edges

Definition at line 112 of file Node.h.

112{ return _out_edges; }

Referenced by onert::dumper::dot::DotBuilder::update().

◆ setAttribute()

void onert::dumper::dot::Node::setAttribute ( const std::string &  key,
const std::string &  val 
)

Store an attribute with key-value pair.

Parameters
[in]keyattribute's key
[in]valattribute's value that is associated with the key

Definition at line 30 of file Node.cc.

30{ _attributes[key] = val; }

Referenced by onert::dumper::dot::Operand::Operand(), and onert::dumper::dot::Operation::Operation().

Field Documentation

◆ BG_COLORS

const std::string onert::dumper::dot::Node::BG_COLORS[8] = {"1", "2", "3", "4", "5", "6", "7", "8"}
inlinestatic

Definition at line 57 of file Node.h.

57{"1", "2", "3", "4", "5", "6", "7", "8"};

◆ DEFAULT_COLORSCHEME

const std::string onert::dumper::dot::Node::DEFAULT_COLORSCHEME = "white"
inlinestatic

Definition at line 55 of file Node.h.

Referenced by Node().

◆ DEFAULT_FILLCOLOR

const std::string onert::dumper::dot::Node::DEFAULT_FILLCOLOR = "x11"
inlinestatic

Definition at line 54 of file Node.h.

Referenced by Node(), and onert::dumper::dot::Operation::Operation().


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