ArmNN
 21.02
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 93 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 95 of file Logging.hpp.

References armnn::LevelToString().

96  : m_LogSinks(sinks)
97  , m_Enabled(enabled)
98  {
99  if (enabled)
100  {
101  m_Os << LevelToString(level) << ": ";
102  }
103  }
std::string LevelToString(LogSeverity level)
Definition: Logging.hpp:15

◆ ~ScopedRecord()

~ScopedRecord ( )
inline

Definition at line 105 of file Logging.hpp.

106  {
107  if (m_Enabled)
108  {
109  for (auto sink : m_LogSinks)
110  {
111  if (sink)
112  {
113  sink->Consume(m_Os.str());
114  }
115  }
116  }
117  }

◆ 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 126 of file Logging.hpp.

127  {
128  if (m_Enabled)
129  {
130  m_Os << s;
131  }
132  return (*this);
133  }

◆ 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: