ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir::DotGraph Class Reference

#include <DotGraph.h>

Public Member Functions

void addNode (DotNode node)
 
void addEdge (DotEdge edge)
 

Friends

std::ostream & operator<< (std::ostream &stream, const DotGraph &graph)
 

Detailed Description

Definition at line 40 of file DotGraph.h.

Member Function Documentation

◆ addEdge()

void mir::DotGraph::addEdge ( DotEdge  edge)

Definition at line 24 of file DotGraph.cpp.

24{ _edges.emplace_back(edge); }

Referenced by mir::dumpGraph().

◆ addNode()

void mir::DotGraph::addNode ( DotNode  node)

Definition at line 22 of file DotGraph.cpp.

22{ _nodes.emplace_back(std::move(node)); }

Referenced by mir::dumpGraph().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  stream,
const DotGraph graph 
)
friend

Definition at line 26 of file DotGraph.cpp.

27{
28 stream << "digraph D {" << std::endl;
29 for (const auto &node : graph._nodes)
30 {
31 stream << node.id << " [shape=record label=\"" << node.label << "\"];" << std::endl;
32 }
33 for (const auto &edge : graph._edges)
34 {
35 stream << edge.src_id << " -> " << edge.dst_id << ";" << std::endl;
36 }
37 stream << "}" << std::endl;
38 return stream;
39}

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