ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 = "white"
 
static const std::string DEFAULT_COLORSCHEME = "x11"
 
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 55 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 31 of file Node.cc.

31 : _id{id}
32{
33 // Set default values
34 _attributes["style"] = "filled";
35 _attributes["colorscheme"] = DEFAULT_COLORSCHEME;
36 _attributes["fillcolor"] = DEFAULT_FILLCOLOR;
37}
static const std::string DEFAULT_COLORSCHEME
Definition Node.h:59
static const std::string DEFAULT_FILLCOLOR
Definition Node.h:58

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 109 of file Node.h.

109{ _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 88 of file Node.h.

88{ 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 41 of file Node.cc.

42{
43 auto itr = _attributes.find(key);
44 if (itr == _attributes.end())
45 {
46 return "";
47 }
48 else
49 {
50 return itr->second;
51 }
52}

◆ id()

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

return id

Returns
id

Definition at line 81 of file Node.h.

81{ 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 115 of file Node.h.

115{ 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 39 of file Node.cc.

39{ _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 = {"1", "2", "3", "4", "5", "6", "7", "8"}
static

Definition at line 60 of file Node.h.

◆ DEFAULT_COLORSCHEME

const std::string onert::dumper::dot::Node::DEFAULT_COLORSCHEME = "x11"
static

Definition at line 59 of file Node.h.

Referenced by Node().

◆ DEFAULT_FILLCOLOR

const std::string onert::dumper::dot::Node::DEFAULT_FILLCOLOR = "white"
static

Definition at line 58 of file Node.h.

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


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