27 if (!
object.m_Measurements.empty() || !
object.m_Children.empty())
40 if (!
object.m_Children.empty())
42 for (
unsigned int childIndex = 0; childIndex <
object.m_Children.size(); ++childIndex)
46 if (&
object.m_Children[childIndex] != &
object.m_Children.back())
59 m_OutputStream <<
"{" << std::endl;
60 IncrementNumberOfTabs();
66 m_OutputStream << R
"("ArmNN": {)" << std::endl; 67 IncrementNumberOfTabs(); 70 std::string JsonPrinter::MakeKey(const std::string& label,
size_t id)
73 ss << label << std::string(
"_#") << id;
80 m_OutputStream << R
"(")" << MakeKey(label, id) << R
"(": {)" << std::endl; 81 IncrementNumberOfTabs(); 87 m_OutputStream << R
"("unit": ")"; 89 m_OutputStream << R"(")"; 100 return "Measurement";
113 m_OutputStream << R
"("type": ")"; 114 m_OutputStream << ToString(type); 115 m_OutputStream << R"(")"; 121 if (measurementsVector.empty())
127 m_OutputStream << R
"("raw": [)" << std::endl; 128 IncrementNumberOfTabs(); 130 auto iter = measurementsVector.begin();
131 m_OutputStream << *iter;
132 for (iter = std::next(iter); iter != measurementsVector.end(); ++iter)
134 m_OutputStream <<
"," << std::endl;
136 m_OutputStream << *iter;
138 m_OutputStream << std::endl;
139 DecrementNumberOfTabs();
141 m_OutputStream <<
"]";
144 void JsonPrinter::PrintTabs()
146 unsigned int numTabs = m_NumTabs;
147 while (numTabs-- > 0)
149 m_OutputStream <<
"\t";
155 m_OutputStream <<
",";
160 m_OutputStream << std::endl;
165 DecrementNumberOfTabs();
167 m_OutputStream <<
"}";
170 void JsonPrinter::DecrementNumberOfTabs()
179 void JsonPrinter::IncrementNumberOfTabs()
static const char * ToString(Unit unit)
Copyright (c) 2020 ARM Limited.
void PrintMeasurementsList(const std::vector< double > &measurementsVector)
void PrintType(armnn::JsonObjectType type)
void PrintJsonChildObject(const JsonChildObject &object, size_t &id)
void PrintLabel(const std::string &label, size_t id)
void PrintUnit(armnn::Measurement::Unit unit)