ArmNN  NotReleased
NodeContent Class Reference

#include <DotSerializer.hpp>

Inheritance diagram for NodeContent:
DotBase

Public Member Functions

 NodeContent (std::ostream &stream)
 
NodeContentSetName (const std::string &name)
 
NodeContentAddContent (const std::string &content)
 
 ~NodeContent ()
 
- Public Member Functions inherited from DotBase
 DotBase (std::ostream &stream)
 
std::ostream & GetStream ()
 

Detailed Description

Definition at line 88 of file DotSerializer.hpp.

Constructor & Destructor Documentation

◆ NodeContent()

NodeContent ( std::ostream &  stream)
explicit

Definition at line 136 of file DotSerializer.cpp.

137  : DotBase(stream)
138 {
139 }
DotBase(std::ostream &stream)

◆ ~NodeContent()

Definition at line 153 of file DotSerializer.cpp.

References DotBase::GetStream().

154 {
155  std::stringstream ss;
156  ss << "label=\"{" << m_Name;
157  if (!m_Contents.empty())
158  {
159  ss << "|";
160  }
161  for (auto & content : m_Contents)
162  {
163  ss << Escape(content);
164  ss << "\\l";
165  }
166  ss << "}\"";
167 
168  std::string s;
169  try
170  {
171  // Coverity fix: std::stringstream::str() may throw an exception of type std::length_error.
172  s = ss.str();
173  }
174  catch (const std::exception&) { } // Swallow any exception.
175 
176  GetStream() << s;
177 }
std::ostream & GetStream()

Member Function Documentation

◆ AddContent()

NodeContent & AddContent ( const std::string &  content)

Definition at line 147 of file DotSerializer.cpp.

Referenced by Graph::SerializeToDot().

148 {
149  m_Contents.push_back(content);
150  return *this;
151 }

◆ SetName()

NodeContent & SetName ( const std::string &  name)

Definition at line 141 of file DotSerializer.cpp.

142 {
143  m_Name = name;
144  return *this;
145 }

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