7#if defined(BI_COMP_BORLANDC)
18# define __TRACE_PREVIOUSLY_DEFINED
24#if !defined(__TRACE_PREVIOUSLY_DEFINED)
25#define _DONT_DECLARE_DEF_DIAG_GROUP
30#if defined(BI_COMP_BORLANDC)
37# if defined(BI_COMP_GNUC)
44#if defined(BI_MULTI_THREAD_RTL)
56#if defined(_BUILDOWLDLL)
57# if defined(__DEBUG) && defined(__TRACE_PREVIOUSLY_DEFINED)
63# if defined(__DEBUG) && defined(__TRACE_PREVIOUSLY_DEFINED)
70struct TDiagProcessData
78 TDiagProcessData(
const TDiagProcessData&);
79 TDiagProcessData&
operator =(
const TDiagProcessData&);
81 static TDiagProcessData& GetInstance()
97 static TDiagProcessData
d;
101 static TDiagProcessData& InitDiagProcessDataInstance;
105#if defined(BI_MULTI_THREAD_RTL)
107 template <
class TData,
bool Shared>
115 explicit TLockT(TDiagProcessData&
data = TDiagProcessData::GetInstance())
124 template <
class TData,
bool Shared>
133 template <
class TData>
140 explicit TLockT(TDiagProcessData&
data = TDiagProcessData::GetInstance())
148 template <
class TData>
158TDiagProcessData& TDiagProcessData::InitDiagProcessDataInstance = TDiagProcessData::GetInstance();
194 RemoveDiagGroup(
this);
201 if (
lock.Data.DiagGroupStaticHead ==
nullptr)
206 while (
last->NextGroup)
213TDiagBase::RemoveDiagGroup(TDiagBase*
group)
215 TDiagProcessData::TLock
lock;
216 if (
lock.Data.DiagGroupStaticHead ==
group)
217 lock.Data.DiagGroupStaticHead =
group->NextGroup;
238 return curr->NextGroup;
241 return lock.Data.DiagGroupStaticHead;
254 if (
lock.Data.GlobalHook)
256 lock.Data.GlobalHook->Output(
this,
msg.c_str());
273#if defined(BI_COMP_MSC)
287static LONG TraceIndent = 0;
296 Trace(
_T(
">> "),
nullptr);
318 Trace(
_T(
"<< "),
nullptr);
331 Group.
Trace(
out.str().c_str(), Level, File, Line);
418 error +=
_T(
"\n\nSelect Abort to terminate, Retry to debug, or Ignore to continue.");
#define OWL_OUTPUT_DEBUG_STRING(lpsz)
Diagnostic macros for assertions and tracing.
#define OWL_DIAG_DEFINE_GROUP_INIT(f, g, e, l)
#define OWL_DIAG_DEFINE_EXPORTGROUP_INIT(f, g, e, l)
#define DIAG_DEFINE_GROUP_INIT(f, g, e, l)
#define DIAG_DEFINE_EXPORTGROUP_INIT(f, g, e, l)
TCheckFailure(const tstring &msg, LPCSTR file, int line)
void Trace(const tstring &msg, int level, LPCSTR file, int line)
TDiagBaseHook * LocalHook
static TDiagBase * GetDiagGroup(TDiagBase *curr=nullptr)
TDiagBase(LPCSTR name, bool enable, int level)
static TDiagBaseHook * SetGlobalHook(TDiagBaseHook *hook=nullptr)
void Warn(const tstring &msg, int level, LPCSTR file, int line)
static tstring ToString(LPCSTR s)
virtual const char * what() const noexcept
static int BreakMessage(LPCSTR type, const tstring &msg, LPCSTR file, int line)
virtual tstring why() const
TDiagException(LPCSTR type, const tstring &msg, LPCSTR file, int line)
TDiagFunction(TDiagBase &group, int level, LPCTSTR function, LPCSTR file, int line)
friend class TMRSWSection::TLock
TPreconditionFailure(const tstring &msg, LPCSTR file, int line)
const char * what() const noexcept
Definition of class TModule.
Object Windows Library (OWLNext Core)
std::ostringstream tostringstream
General definitions used by all ObjectWindows programs.
virtual void Output(TDiagBase *group, LPCTSTR str)=0