ArmNN
 20.11
ScopedRecord Struct Reference

#include <Logging.hpp>

Public Member Functions

 ScopedRecord (const std::vector< std::shared_ptr< LogSink >> &sinks, LogSeverity level, bool enabled)
 
 ~ScopedRecord ()
 
 ScopedRecord (const ScopedRecord &)=delete
 
ScopedRecordoperator= (const ScopedRecord &)=delete
 
ScopedRecordoperator= (ScopedRecord &&)=delete
 
 ScopedRecord (ScopedRecord &&other)=default
 
template<typename Streamable >
ScopedRecordoperator<< (const Streamable &s)
 

Detailed Description

Definition at line 54 of file Logging.hpp.

Constructor & Destructor Documentation

◆ ScopedRecord() [1/3]

ScopedRecord ( const std::vector< std::shared_ptr< LogSink >> &  sinks,
LogSeverity  level,
bool  enabled 
)
inline

Definition at line 56 of file Logging.hpp.

References armnn::LevelToString().

57  : m_LogSinks(sinks)
58  , m_Enabled(enabled)
59  {
60  if (enabled)
61  {
62  m_Os << LevelToString(level) << ": ";
63  }
64  }
std::string LevelToString(LogSeverity level)
Definition: Logging.hpp:14

◆ ~ScopedRecord()

~ScopedRecord ( )
inline

Definition at line 66 of file Logging.hpp.

67  {
68  if (m_Enabled)
69  {
70  for (auto sink : m_LogSinks)
71  {
72  if (sink)
73  {
74  sink->Consume(m_Os.str());
75  }
76  }
77  }
78  }

◆ ScopedRecord() [2/3]

ScopedRecord ( const ScopedRecord )
delete

◆ ScopedRecord() [3/3]

ScopedRecord ( ScopedRecord &&  other)
default

Member Function Documentation

◆ operator<<()

ScopedRecord& operator<< ( const Streamable &  s)
inline

Definition at line 87 of file Logging.hpp.

88  {
89  if (m_Enabled)
90  {
91  m_Os << s;
92  }
93  return (*this);
94  }

◆ operator=() [1/2]

ScopedRecord& operator= ( const ScopedRecord )
delete

◆ operator=() [2/2]

ScopedRecord& operator= ( ScopedRecord &&  )
delete

The documentation for this struct was generated from the following file: