8#ifndef HPP_ALIB_CAMP_MESSAGE_REPORT
9#define HPP_ALIB_CAMP_MESSAGE_REPORT 1
11#if !defined (HPP_ALIB_CAMP_MESSAGE_MESSAGE)
14#if !defined (HPP_ALIB_LANG_BASECAMP)
19#if !defined(_GLIBCXX_STACK) && !defined(_STACK_)
29namespace lang {
class ReportWriter;
90 #if !defined(ALIB_DOX)
123 bool recursionBlocker =
false;
159 if ( defaultReport ==
nullptr )
160 defaultReport=
new Report();
161 return *defaultReport;
174 void DoReport(
Message& message );
186 template <
typename...
Boxes>
190 Message message( file, line, func, type, std::forward<Boxes>(msgs)...);
203 void PushHaltFlags(
bool haltOnErrors,
bool haltOnWarnings );
286 #if !defined(ALIB_DOX)
308 virtual void NotifyActivation (
lang::Phase phase )
override;
339#if ALIB_DEBUG && !defined(ALIB_DOX)
345 #undef ALIB_ASSERT_ERROR
346 #undef ALIB_ASSERT_WARNING
347 #undef ALIB_ASSERT_MESSAGE
349 #define ALIB_ERROR( ... ) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Error , __VA_ARGS__ ); }
350 #define ALIB_WARNING( ... ) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Warning, __VA_ARGS__ ); }
351 #define ALIB_MESSAGE( ... ) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Message, __VA_ARGS__ ); }
353 #define ALIB_ASSERT( cond ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Error , "Internal Error" ); } }
354 #define ALIB_ASSERT_ERROR( cond, ... ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Error , __VA_ARGS__ ); } }
355 #define ALIB_ASSERT_WARNING( cond, ... ) { if (!(cond)) { alib::lang::Report::GetDefault().DoReport( ALIB_CALLER_PRUNED, alib::lang::Report::Types::Warning, __VA_ARGS__ ); } }
356 #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
ReportWriterStdIO()=default
virtual void Report(Message &msg)=0
virtual void NotifyActivation(lang::Phase phase)=0
std::stack< ReportWriter * > writers
static ALIB_API Report * defaultReport
static Report & GetDefault()
std::stack< int > haltAfterReport
void DoReport(const NCString &file, int line, const NCString &func, const Enum &type, Boxes &&... msgs)
#define ALIB_IF_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)
lang::basecamp::BaseCamp BASECAMP
threads::ThreadLock ThreadLock
Type alias in namespace alib.