8#ifndef HPP_ALIB_CAMP_MESSAGE_REPORT
9#define HPP_ALIB_CAMP_MESSAGE_REPORT 1
26namespace lang {
class ReportWriter;
114 bool recursionBlocker =
false;
148 if ( defaultReport ==
nullptr )
149 defaultReport=
new Report();
150 return *defaultReport;
163 void DoReport(
Message& message );
173 template <
typename... Boxes>
175 const Enum& type, Boxes&&... msgs )
178 Message message( ci, allocator, type, std::forward<Boxes>(msgs)...);
191 void PushHaltFlags(
bool haltOnErrors,
bool haltOnWarnings );
323#if ALIB_DEBUG && !DOXYGEN
329 #undef ALIB_ASSERT_ERROR
330 #undef ALIB_ASSERT_WARNING
331 #undef ALIB_ASSERT_MESSAGE
333 #define ALIB_ERROR( ... ) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Error , __VA_ARGS__ ); }
334 #define ALIB_WARNING( ... ) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Warning, __VA_ARGS__ ); }
335 #define ALIB_MESSAGE( ... ) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Message, __VA_ARGS__ ); }
337 #define ALIB_ASSERT( cond ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Error , "Internal Error." ); } }
338 #define ALIB_ASSERT_ERROR( cond, ... ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Error , __VA_ARGS__ ); } }
339 #define ALIB_ASSERT_WARNING( cond, ... ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Warning, __VA_ARGS__ ); } }
340 #define ALIB_ASSERT_MESSAGE( cond, ... ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Message, __VA_ARGS__ ); } }
virtual ~ReportWriterStdIO() override=default
Private destructor.
ReportWriterStdIO()=default
virtual void NotifyActivation(lang::Phase) override
Notify activation/deactivation.
virtual ~ReportWriter()
Virtual destructor.
virtual void Report(Message &msg)=0
virtual void NotifyActivation(lang::Phase phase)=0
void DoReport(const CallerInfo &ci, const Enum &type, Boxes &&... msgs)
std::stack< ReportWriter * > writers
threads::RecursiveLock lock
A Lock to protect against multithreaded calls.
static ALIB_API Report * defaultReport
The default Report used internally by ALib and usually by processes that rely on ALib.
static Report & GetDefault()
std::stack< int > haltAfterReport
#define IF_ALIB_THREADS(...)
#define ALIB_ASSERT_GLOBAL_NAMESPACE
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
#define ALIB_RESOURCED_IN_MODULE(T, Camp, ResName)
ReportExceptions
Exception codes of class Report.
Phase
Denotes a phase, e.g.,of a transaction.
lang::basecamp::BaseCamp BASECAMP
The singleton instance of ALib Camp class BaseCamp.
threads::RecursiveLock RecursiveLock
Type alias in namespace alib.