ArmNN
 24.02
JsonUtils Class Reference

#include <JsonUtils.hpp>

Inheritance diagram for JsonUtils:
[legend]

Public Member Functions

 JsonUtils (std::ostream &outputStream)
 
void PrintTabs ()
 
void DecrementNumberOfTabs ()
 
void IncrementNumberOfTabs ()
 
void PrintNewLine ()
 
void PrintFooter ()
 
void PrintHeader ()
 
void PrintArmNNHeader ()
 
void PrintSeparator ()
 

Detailed Description

Definition at line 16 of file JsonUtils.hpp.

Constructor & Destructor Documentation

◆ JsonUtils()

JsonUtils ( std::ostream &  outputStream)
inline

Definition at line 19 of file JsonUtils.hpp.

20  : m_NumTabs(0), m_OutputStream(outputStream)
21  {}

Member Function Documentation

◆ DecrementNumberOfTabs()

void DecrementNumberOfTabs ( )
inline

Definition at line 32 of file JsonUtils.hpp.

33  {
34  if ( m_NumTabs == 0 )
35  {
36  return;
37  }
38  --m_NumTabs;
39  }

Referenced by JsonUtils::PrintFooter(), JsonPrinter::PrintJsonChildObject(), and JsonPrinter::PrintMeasurementsList().

◆ IncrementNumberOfTabs()

void IncrementNumberOfTabs ( )
inline

◆ PrintArmNNHeader()

void PrintArmNNHeader ( )
inline

Definition at line 64 of file JsonUtils.hpp.

65  {
66  PrintTabs();
67  m_OutputStream << R"("ArmNN": {)" << std::endl;
69  }

References JsonUtils::IncrementNumberOfTabs(), and JsonUtils::PrintTabs().

Referenced by ProfilerImpl::Print().

◆ PrintFooter()

void PrintFooter ( )
inline

Definition at line 51 of file JsonUtils.hpp.

52  {
54  PrintTabs();
55  m_OutputStream << "}";
56  }

References JsonUtils::DecrementNumberOfTabs(), and JsonUtils::PrintTabs().

Referenced by ProfilingDetails::AddDetailsToString(), ProfilerImpl::Print(), and JsonPrinter::PrintJsonChildObject().

◆ PrintHeader()

void PrintHeader ( )
inline

Definition at line 58 of file JsonUtils.hpp.

59  {
60  m_OutputStream << "{" << std::endl;
62  }

References JsonUtils::IncrementNumberOfTabs().

Referenced by ProfilingDetails::AddDetailsToString(), and ProfilerImpl::Print().

◆ PrintNewLine()

void PrintNewLine ( )
inline

Definition at line 46 of file JsonUtils.hpp.

47  {
48  m_OutputStream << std::endl;
49  }

Referenced by ProfilingDetails::AddDetailsToString(), ProfilerImpl::Print(), and JsonPrinter::PrintJsonChildObject().

◆ PrintSeparator()

void PrintSeparator ( )
inline

Definition at line 70 of file JsonUtils.hpp.

71  {
72  m_OutputStream << ",";
73  }

Referenced by ProfilingDetails::AddDetailsToString(), ProfilerImpl::Print(), and JsonPrinter::PrintJsonChildObject().

◆ PrintTabs()

void PrintTabs ( )
inline

Definition at line 23 of file JsonUtils.hpp.

24  {
25  unsigned int numTabs = m_NumTabs;
26  while ( numTabs-- > 0 )
27  {
28  m_OutputStream << "\t";
29  }
30  }

Referenced by ProfilingDetails::AddDetailsToString(), JsonUtils::PrintArmNNHeader(), JsonUtils::PrintFooter(), JsonPrinter::PrintGuid(), JsonPrinter::PrintJsonChildObject(), JsonPrinter::PrintLabel(), JsonPrinter::PrintMeasurementsList(), JsonPrinter::PrintType(), and JsonPrinter::PrintUnit().


The documentation for this class was generated from the following file:
armnn::JsonUtils::IncrementNumberOfTabs
void IncrementNumberOfTabs()
Definition: JsonUtils.hpp:41
armnn::JsonUtils::DecrementNumberOfTabs
void DecrementNumberOfTabs()
Definition: JsonUtils.hpp:32
armnn::JsonUtils::PrintTabs
void PrintTabs()
Definition: JsonUtils.hpp:23