24#ifndef __SWRE_TRACER_H__
25#define __SWRE_TRACER_H__
27#include <Safir/Application/Internal/SwReportExportDefs.h>
28#include <Safir/Application/Internal/TraceStreamBuffer.h>
72 typedef std::basic_ios<wchar_t, std::char_traits<wchar_t> > ios_type;
74 typedef std::basic_ostream<wchar_t, std::char_traits<wchar_t> >
stream_type;
81 explicit Tracer(
const std::wstring & prefix);
93 void Enable(
const bool enabled) {
if (m_isEnabled == NULL) {InitializeEnabledHandling();} *m_isEnabled = enabled;}
100 inline bool IsEnabled()
const {
if (m_isEnabled == NULL) {InitializeEnabledHandling();}
return *m_isEnabled;}
119 inline const Tracer & operator << (std::ios_base & (* _Pfn)(std::ios_base &))
const
146 inline const Tracer & operator << (
const T & data)
const
169 void InitializeEnabledHandling()
const;
171 mutable stream_type m_ostream;
172 mutable Internal::TraceStreamBuffer m_buf;
173 mutable volatile bool * m_isEnabled;
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
This class just contains two static methods, for starting and stopping the tracers backdoor.
Definition Tracer.h:40
static void Stop()
Stop reception of trace on/off commands.
static void Start(const Safir::Dob::ConnectionBase &connection)
Start reception of trace on/off commands.
A class for trace logging.
Definition Tracer.h:70
void Enable(const bool enabled)
Turn logging of this prefix on or off.
Definition Tracer.h:93
const Tracer & operator<<(ios_type &(*_Pfn)(ios_type &)) const
Output operator for io manipulators.
Definition Tracer.h:132
bool IsEnabled() const
Check whether this prefix is enabled or not.
Definition Tracer.h:100
stream_type & stream() const
Get the underlying ostream of the logger.
Definition Tracer.h:167
Tracer(const std::wstring &prefix)
Constructor.
std::basic_ostream< wchar_t, std::char_traits< wchar_t > > stream_type
Definition Tracer.h:74
Common base class for connections to the DOB.
Definition ConnectionBase.h:59