TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::experimental::utility::report_stream

#include <triqs/utility/report_stream.hpp>

Detailed Description

Output stream with a configurable verbosity level.

It behaves like a std::ostream but each operator<<() call is conditional on the current verbosity level. It only emits output when the verbosity level is greater than zero. The verbosity level is set at construction time and can be (temporarily) reduced using operator()().

Definition at line 45 of file report_stream.hpp.

Public Member Functions

 report_stream (std::ostream &out_, int verbosity_=1)
 Construct a report stream from a reference to an ostream and a verbosity level.
 report_stream (std::ostream *out_, int verbosity_=1)
 Construct a report stream from a pointer to an ostream and a verbosity level.
report_stream operator() (int n) const
 Return a child report stream whose verbosity has been reduced by \( n - 1 \).
report_streamoperator<< (std::ostream &(*manip)(std::ostream &))
 Streaming operator that accepts manipulators like std::endl.
template<class T>
report_streamoperator<< (T const &x)
 Streaming operator to write the given argument if the current verbosity is greater than zero.

Constructor & Destructor Documentation

◆ report_stream() [1/2]

triqs::utility::report_stream::report_stream ( std::ostream * out_,
int verbosity_ = 1 )
inline

Construct a report stream from a pointer to an ostream and a verbosity level.

Parameters
out_Pointer to the underlying std::ostream.
verbosity_Verbosity level.

Definition at line 56 of file report_stream.hpp.

◆ report_stream() [2/2]

triqs::utility::report_stream::report_stream ( std::ostream & out_,
int verbosity_ = 1 )
inline

Construct a report stream from a reference to an ostream and a verbosity level.

Parameters
out_Reference to the underlying std::ostream.
verbosity_Verbosity level.

Definition at line 64 of file report_stream.hpp.

Member Function Documentation

◆ operator()()

report_stream triqs::utility::report_stream::operator() ( int n) const
inline

Return a child report stream whose verbosity has been reduced by \( n - 1 \).

Parameters
nAmount by which to lower the verbosity threshold.
Returns
A report stream writing to the same ostream with the reduced verbosity.

Definition at line 72 of file report_stream.hpp.

◆ operator<<() [1/2]

report_stream & triqs::utility::report_stream::operator<< ( std::ostream &(* manip )(std::ostream &))
inline

Streaming operator that accepts manipulators like std::endl.

Parameters
manipStream manipulator applied to the underlying ostream when verbosity is greater than zero.
Returns
Reference to *this to allow chaining.

Definition at line 92 of file report_stream.hpp.

◆ operator<<() [2/2]

template<class T>
report_stream & triqs::utility::report_stream::operator<< ( T const & x)
inline

Streaming operator to write the given argument if the current verbosity is greater than zero.

Template Parameters
TType to be written.
Parameters
xObject to write to the underlying ostream.
Returns
Reference to *this to allow chaining.

Definition at line 81 of file report_stream.hpp.


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