ArmNN
 21.02
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 135 of file DotSerializer.cpp.

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

◆ ~NodeContent()

Definition at line 152 of file DotSerializer.cpp.

References DotBase::GetStream().

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

Member Function Documentation

◆ AddContent()

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

Definition at line 146 of file DotSerializer.cpp.

Referenced by Graph::SerializeToDot().

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

◆ SetName()

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

Definition at line 140 of file DotSerializer.cpp.

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

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