88 using ptr = std::shared_ptr<diagnostic_base>;
101 bool in_code_only =
false);
127 virtual unsigned id()
const {
143 explicit operator unsigned ()
const {
158 explicit operator std::string ()
const {
237 static size_t flush(
unsigned reason) {
298 void despatch()
const throw (
unsigned);
315 return (
int(level) << 8) |
id;
362 std::list<ptr>::iterator qit(
_queue_.begin());
363 while ( qit !=
_queue_.end()) {
364 if ((qit->get()->*selector)() == match) {
366 (qit->get()->*action)();
385 template<severity Level,
unsigned Id>
395 static const unsigned _id_ = Id;
402 :
base(severity_name,Level,Id) {}
410 unsigned id()
const {
434 template<
unsigned Id>
442 :
base(
"progress") {}
449 template<
unsigned Id>
472 template<
unsigned Id>
484 virtual void count()
const override {
494 template<
unsigned Id>
517 template<
unsigned Id>
540 template<
unsigned Id>
553 template<
unsigned Id>
565 template<
unsigned Id>
static size_t volley(T match, T(diagnostic_base::*selector)() const, void(diagnostic_base::*action)() const =nullptr)
Call a member function on all queued diagnostics for which a given member function returns a given re...
diagnostic_base(diagnostic_base const &src)
Copy constructor.
void count() const override
Increment the global count of informational diagnostics.
bool gagged() const
Say whether this diagnostic is suppressed.
template struct warning_msg<Id> generically encapsulates a warning diagnostic.
A fatal error disgnostic.
static unsigned _abends_
Global count of fatal error diagnostics.
std::shared_ptr< diagnostic_base > ptr
Type of pointer to diagnostic_base
static size_t deferred()
Count the diagnostics enqueued for deferred action.
template struct error_msg<Id> generically encapsulates an error diagnostic.
An informational diagnostic.
static unsigned code(severity level, unsigned id)
Get the reason-code that encodes a causal identifier and severity.
static void discard_all()
Discard all queued diagnostics.
template struct warning_summary_msg<Id> generically encapsulates a warning summary diagnostic...
diagnostic_base(std::string const &severity_name, severity level, unsigned id, bool in_code_only=false)
Constructor.
progress_summary_msg()
Default constructor.
void queue() const
Globally enqueue a copy of this diagnostic_base for deferred action.
virtual unsigned id() const
Get the unique identifier of the runtime type.
virtual diagnostic_base * clone() const
Clone the runtime object on the heap.
static unsigned code()
Get the reason-code of this diagnostic's type.
static size_t flush()
Emit all deferred diagnostics of this type.
A utility class to prevent assignment of containing class.
static void flush_all()
Emit any queued diagnostics.
A base class for diagnostic classes.
`template struct diagnostic<Level,Id> generically encapsulates a type of diagnostic.
template struct abend_msg generically encapsulates a fatal error diagnostic.
static int exitcode()
Convert the internal exit status to an exit code for exit().
template struct info_summary_msg<Id> generically encapsulates an informational summary diagnostic...
static std::list< ptr > _queue_
Queue of deferred diagnostics.
void count() const override
Increment the global count of abend diagnostics.
struct warning_unconditional_error_output encapsulates a diagnostic for an error directive output unc...
warning_msg()
Constructor.
void count() const override
Increment global counts appropriately.
static const severity _severity_
The severity level of this diagnostic type.
static unsigned _errors_
Global count of error diagnostics.
severity
Enumerated constants representing the severities of diagnostics.
unsigned id() const
Get the causal identifier of this diagnostic.
template struct progress_msg<Id>` generically encapsulates a progress diagnostic. ...
diagnostic_base & operator<<(T const &obj)
Insert an arbitrary object into the diagnostic.
static const unsigned _id_
The causal identifier of this diagnostic type.
virtual void count() const
Increment global counts appropriately for the runtime type.
An informational summary.
bool _gagged
Is the diagnostic suppressed?
static size_t flush(unsigned reason)
Emit all queued diagnostics that match a reason-code.
template struct info_msg generically encapsulates an informational diagnostic.
static void epilogue()
Write summary diagnostics on cerr at exit.
warning_summary_msg()
Default constructor.
static size_t discard()
Forget all queued diagnostics of this type.
The tag class is inserted in a diagnostic_base to tell it to emit itself.
static unsigned _error_directives_generated_
Global count of error directives output.
The tag class is inserted in a diagnostic_base to tell it to defer itself.
static size_t flush(severity level)
Emit all queued diagnostics that match a severity.
diagnostic_base & operator<<(defer)
Queue the diagnostic for deferred action.
static unsigned _error_directives_operative_
Global count of operative error directives output.
std::string text() const
Get the text of the diagnostic.
template struct cloner<B,D> is a base template from which derived instantiations can inherit cloneabi...
progress_msg()
Constructor.
template struct progress_summary_msg<Id> generically encapsulates a progress summary diagnostic...
diagnostic_base & operator<<(emit)
Emit the diagnostic.
virtual severity level() const
Get the severity level of the runtime type.
static size_t discard(unsigned reason)
Discard any queued diagnostics that match a reason-code, returning the number discarded.
virtual void count() const override
Increment the global count of warning diagnostics.
`template struct warning_error_generated_input' encapsulates a diagnostic for error directive output ...
static unsigned _warnings_
Global count of warning diagnostics.
static size_t discard(severity level)
Discard any queued diagnostics that match a severity, returning the number discarded.
void count() const override
Increment the global count of error diagnostics.
severity level() const
Get the severity level of this diagnostic.
unsigned encode() const
Get the reason-code of the diagnostic.
void count() const override
Increment global counts appropriately.
std::stringstream _text
The text of the diagnostic.
static unsigned _infos_
Global count of informational diagnostics.
diagnostic(std::string const &severity_name)
Explicitly construct given a severity name.
void despatch() const
Emit the diagnostic.
info_summary_msg()
Default constructor.