ArmNN
 25.11
Loading...
Searching...
No Matches
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)
template<typename Streamable>
ScopedRecordoperator<< (const Streamable &s)

Detailed Description

Definition at line 100 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 102 of file Logging.hpp.

103 : m_LogSinks(sinks)
104 , m_Enabled(enabled)
105 {
106 if (enabled)
107 {
108 m_Os << LevelToString(level) << ": ";
109 }
110 }
std::string LevelToString(LogSeverity level)
Definition Logging.hpp:22

References armnn::LevelToString().

Referenced by operator<<(), operator=(), operator=(), ScopedRecord(), and ScopedRecord().

◆ ~ScopedRecord()

~ScopedRecord ( )
inline

Definition at line 112 of file Logging.hpp.

113 {
114 if (m_Enabled)
115 {
116 for (auto sink : m_LogSinks)
117 {
118 if (sink)
119 {
120 sink->Consume(m_Os.str());
121 }
122 }
123 }
124 }

◆ ScopedRecord() [2/3]

ScopedRecord ( const ScopedRecord & )
delete

References ScopedRecord().

◆ ScopedRecord() [3/3]

ScopedRecord ( ScopedRecord && other)
inline

Definition at line 130 of file Logging.hpp.

131 : m_LogSinks(other.m_LogSinks)
132 , m_Os(std::move(other.m_Os))
133 , m_Enabled(other.m_Enabled)
134 {
135 // Disable the moved-from ScopedRecord, to prevent it from sending its (now empty) message to
136 // its sinks.
137 other.m_Enabled = false;
138 }

References ScopedRecord().

Member Function Documentation

◆ operator<<()

template<typename Streamable>
ScopedRecord & operator<< ( const Streamable & s)
inline

Definition at line 141 of file Logging.hpp.

142 {
143 if (m_Enabled)
144 {
145 m_Os << s;
146 }
147 return (*this);
148 }

References ScopedRecord().

◆ operator=() [1/2]

ScopedRecord & operator= ( const ScopedRecord & )
delete

References ScopedRecord().

◆ operator=() [2/2]

ScopedRecord & operator= ( ScopedRecord && )
delete

References ScopedRecord().


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