LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::detail::MessageAccumulator Class Reference

#include "TaskDebugMacros.h"

Public Member Functions

 MessageAccumulator (char const banner_prefix, std::string const &fcn_name, std::string const &pretty_fcn_name, ScheduleID schedule_id=ScheduleID{}, std::string const &step=std::string(6, ' '))
 
 ~MessageAccumulator ()
 
template<typename T >
decltype(auto) operator<< (T const &t)
 

Private Attributes

std::ostringstream buffer_
 
std::ostringstream usr_msg_
 

Detailed Description

Definition at line 31 of file TaskDebugMacros.h.

Constructor & Destructor Documentation

art::detail::MessageAccumulator::MessageAccumulator ( char const  banner_prefix,
std::string const &  fcn_name,
std::string const &  pretty_fcn_name,
ScheduleID  schedule_id = ScheduleID{},
std::string const &  step = std::string(6, ' ') 
)

Definition at line 78 of file TaskDebugMacros.cc.

83  {
84  buffer_ << banner(banner_prefix) << schedule_to_str(sid) << " "
85  << indent_for(step, sid) << std::left << std::setw(6) << step
86  << trimmed(fcn_name, pretty_fcn_name);
87  }
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
art::detail::MessageAccumulator::~MessageAccumulator ( )

Definition at line 89 of file TaskDebugMacros.cc.

References util::empty().

90  {
91  auto const user_message = usr_msg_.str();
92  if (not empty(user_message)) {
93  buffer_ << " - " << user_message;
94  }
95  buffer_ << '\n';
96  std::cerr << buffer_.str();
97  }
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109

Member Function Documentation

template<typename T >
decltype(auto) art::detail::MessageAccumulator::operator<< ( T const &  t)
inline

Definition at line 42 of file TaskDebugMacros.h.

43  {
44  usr_msg_ << t;
45  return std::forward<decltype(*this)>(*this);
46  }

Member Data Documentation

std::ostringstream art::detail::MessageAccumulator::buffer_
private

Definition at line 49 of file TaskDebugMacros.h.

std::ostringstream art::detail::MessageAccumulator::usr_msg_
private

Definition at line 50 of file TaskDebugMacros.h.


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