EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::Logging::OutStream Exception Referencefinal

thread-safe output stream More...

#include <acts/blob/sPHENIX/Core/include/Acts/Utilities/Logger.hpp>

+ Collaboration diagram for Acts::Logging::OutStream:

Public Member Functions

 OutStream (OutputFunc output)
 construct stream object
 
 OutStream (const OutStream &copy)
 copy constructor
 
 ~OutStream ()
 destructor
 
template<typename T >
OutStreamoperator<< (T &&input)
 stream input operator forwarded to internal cache
 
template<typename T >
OutStreamoperator<< (T &(*f)(T &))
 forward stream modifiers to internal cache
 

Private Types

using OutputFunc = std::function< void(const std::ostringstream &)>
 function type for output flushing
 

Private Attributes

std::ostringstream m_stream
 internal cache of stream
 
OutputFunc m_outputFunctor
 output function called for flushing cache upon destruction
 

Detailed Description

thread-safe output stream

This classes caches the output internally and only flushes it to the destination stream once it is destroyed. Using local instances of this class therefore provides a thread-safe way for printing debug messages.

Definition at line 201 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 201 of file Logger.hpp

Member Typedef Documentation

using Acts::Logging::OutStream::OutputFunc = std::function<void(const std::ostringstream&)>
private

function type for output flushing

Definition at line 203 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 203 of file Logger.hpp

Constructor & Destructor Documentation

Acts::Logging::OutStream::OutStream ( OutputFunc  output)
inlineexplicit

construct stream object

Parameters
[in]outputfunction object called for flushing the internal cache

Definition at line 210 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 210 of file Logger.hpp

Acts::Logging::OutStream::OutStream ( const OutStream copy)
inline

copy constructor

Parameters
[in]copystream object to copy

Definition at line 216 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 216 of file Logger.hpp

References m_stream.

Acts::Logging::OutStream::~OutStream ( )
inline

destructor

When calling the destructor, the internal cache is flushed using the function provided during construction.

Definition at line 225 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 225 of file Logger.hpp

References m_outputFunctor, and m_stream.

Member Function Documentation

template<typename T >
OutStream& Acts::Logging::OutStream::operator<< ( T &&  input)
inline

stream input operator forwarded to internal cache

Template Parameters
Tinput type
Parameters
[in]inputcontent added to the stream

Definition at line 233 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 233 of file Logger.hpp

template<typename T >
OutStream& Acts::Logging::OutStream::operator<< ( T &(*)(T &)  f)
inline

forward stream modifiers to internal cache

Template Parameters
Tstream type
Parameters
[in]fstream modifier

Definition at line 244 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 244 of file Logger.hpp

References m_stream.

Member Data Documentation

OutputFunc Acts::Logging::OutStream::m_outputFunctor
private

output function called for flushing cache upon destruction

Definition at line 254 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 254 of file Logger.hpp

Referenced by ~OutStream().

std::ostringstream Acts::Logging::OutStream::m_stream
private

internal cache of stream

Definition at line 251 of file Logger.hpp.

View newest version in sPHENIX GitHub at line 251 of file Logger.hpp

Referenced by operator<<(), OutStream(), and ~OutStream().


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