NCBI C++ ToolKit
Classes | Macros | Enumerations | Enumerator | Functions | Variables
Debugging Macros
+ Collaboration diagram for Debugging Macros:

Classes

class  CCheckMe< TValue >
 Wrapper around an object of type TValue, that makes it mandatory to check object value somehow after each assignment. More...
 

Macros

#define _ALWAYS_TRACE(message)
 Define macros to support debugging. More...
 
#define _ALWAYS_TRACE_EX(err_code, err_subcode, message)
 
#define _ALWAYS_TRACE_X(err_subcode, message)    _ALWAYS_TRACE_XX(NCBI_USE_ERRCODE_X, err_subcode, message)
 
#define _ALWAYS_TRACE_XX(error_name, err_subcode, message)
 
#define NCBI_ALWAYS_TROUBLE(mess)    NCBI_NS_NCBI::CNcbiDiag::DiagTrouble(DIAG_COMPILE_INFO, mess)
 
#define NCBI_ALWAYS_ASSERT(expr, mess)
 
#define NCBI_ALWAYS_ASSERT_EXPR(expr, mess)    ((expr)?(void)0:NCBI_NS_NCBI::CNcbiDiag::DiagAssert(DIAG_COMPILE_INFO, #expr, mess))
 
#define NCBI_ALWAYS_VERIFY(expr, mess)   NCBI_ALWAYS_ASSERT(expr, mess)
 
#define _TRACE(message)   _ALWAYS_TRACE(message)
 
#define _TRACE_EX(err_code, err_subcode, message)    _ALWAYS_TRACE_EX(err_code, err_subcode, message)
 
#define _TRACE_X(err_subcode, message)   _ALWAYS_TRACE_X(err_subcode, message)
 
#define _TRACE_XX(error_name, err_subcode, message)    _ALWAYS_TRACE_XX(error_name, err_subcode, message)
 
#define NCBI_TROUBLE(mess)   NCBI_ALWAYS_TROUBLE(mess)
 
#define NCBI_ASSERT(expr, mess)   NCBI_ALWAYS_ASSERT(expr, mess)
 
#define NCBI_ASSERT_EXPR(expr, mess)   NCBI_ALWAYS_ASSERT_EXPR(expr, mess)
 
#define NCBI_VERIFY(expr, mess)   NCBI_ALWAYS_VERIFY(expr, mess)
 
#define _DEBUG_ARG(arg)   arg
 
#define _DEBUG_CODE(code)    do { code } while ( 0 )
 
#define _ASSERT(expr)   NCBI_ASSERT(expr, "")
 
#define _VERIFY(expr)   NCBI_VERIFY(expr, "")
 
#define _TROUBLE   NCBI_TROUBLE("")
 
#define _ALWAYS_ASSERT(expr)   NCBI_ALWAYS_ASSERT(expr, "")
 
#define _ALWAYS_VERIFY(expr)   NCBI_ALWAYS_VERIFY(expr, "")
 
#define _ALWAYS_TROUBLE   NCBI_ALWAYS_TROUBLE("")
 
#define CHECKME_VALIDATE(condition, error_type)
 
#define NAME_NCBI_LIBRARY_VERSION_MISMATCH(a)   Ncbi_library_version_mismatch__Full_rebuild_to_fix_##a
 
#define MAKENAME_NCBI_LIBRARY_VERSION_MISMATCH(a)   NAME_NCBI_LIBRARY_VERSION_MISMATCH(a)
 
#define CHECK_NCBI_LIBRARY_VERSION_MISMATCH   MAKENAME_NCBI_LIBRARY_VERSION_MISMATCH(NCBI_DEVELOPMENT_VER)
 

Enumerations

enum  EValidateAction { eValidate_Default = 0 , eValidate_Abort , eValidate_Throw }
 Which action to perform. More...
 
enum  ECheckMeError { eCheckMe_Unused , eCheckMe_Unset }
 

Functions

void xncbi_SetValidateAction (EValidateAction action)
 Set the action to be performed. More...
 
EValidateAction xncbi_GetValidateAction (void)
 Get the action to be performed. More...
 
void xncbi_CCheckMe_ReportError (ECheckMeError error)
 
 CCheckMe< TValue >::CCheckMe (void)
 
 CCheckMe< TValue >::CCheckMe (const TValue &val)
 
 CCheckMe< TValue >::CCheckMe (const CCheckMe &t)
 
 CCheckMe< TValue >::~CCheckMe (void)
 
CCheckMeCCheckMe< TValue >::operator= (const CCheckMe &t)
 Assignment. More...
 
CCheckMeCCheckMe< TValue >::operator= (const TValue &value)
 
void CCheckMe< TValue >::SetChecked (bool is_checked=true) const
 Force-set to the "checked" state. More...
 
bool CCheckMe< TValue >::operator== (const CCheckMe &t) const
 
bool CCheckMe< TValue >::operator!= (const CCheckMe &t) const
 
template<typename T >
bool CCheckMe< TValue >::operator== (const T &t) const
 
template<typename T >
bool CCheckMe< TValue >::operator!= (const T &t) const
 
 CCheckMe< TValue >::operator TValue (void) const
 Conversion to value type. More...
 
bool CCheckMe< TValue >::IsChecked (void) const
 
int Ncbi_library_version_mismatch__Full_rebuild_to_fix_NCBI_DEVELOPMENT_VER (void)
 

Variables

TValue CCheckMe< TValue >::m_Value
 
bool CCheckMe< TValue >::m_IsSet
 
bool CCheckMe< TValue >::m_IsChecked
 
static NCBI_UNUSED int s__check_ncbi_library_version_mismatch = Ncbi_library_version_mismatch__Full_rebuild_to_fix_NCBI_DEVELOPMENT_VER ()
 

Detailed Description

Macro Definition Documentation

◆ _ALWAYS_ASSERT

#define _ALWAYS_ASSERT (   expr)    NCBI_ALWAYS_ASSERT(expr, "")

Definition at line 164 of file ncbidbg.hpp.

◆ _ALWAYS_TRACE

#define _ALWAYS_TRACE (   message)
Value:
{ NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO, \
<< message << NCBI_NS_NCBI::Endm; } while (0)
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
Definition: ncbidiag.hpp:170
bool IsVisibleDiagPostLevel(EDiagSev sev)
Check if the specified severity is higher or equal to the currently selected post level and will be p...
Definition: ncbidiag.cpp:6166
@ eDiag_Trace
Trace message.
Definition: ncbidiag.hpp:657

Define macros to support debugging.

Definition at line 65 of file ncbidbg.hpp.

◆ _ALWAYS_TRACE_EX

#define _ALWAYS_TRACE_EX (   err_code,
  err_subcode,
  message 
)
Value:
{ NCBI_NS_NCBI::CNcbiDiag(DIAG_COMPILE_INFO, \
<< NCBI_NS_NCBI::ErrCode( (err_code), (err_subcode) ) \
<< message << NCBI_NS_NCBI::Endm; } while (0)
#define ErrCode()
Get the error code for the last failed system function.
Definition: mdb.c:377

Definition at line 71 of file ncbidbg.hpp.

◆ _ALWAYS_TRACE_X

#define _ALWAYS_TRACE_X (   err_subcode,
  message 
)     _ALWAYS_TRACE_XX(NCBI_USE_ERRCODE_X, err_subcode, message)

Definition at line 78 of file ncbidbg.hpp.

◆ _ALWAYS_TRACE_XX

#define _ALWAYS_TRACE_XX (   error_name,
  err_subcode,
  message 
)
Value:
do { (NCBI_CHECK_ERR_SUBCODE_X_NAME(error_name, err_subcode)); \
_ALWAYS_TRACE_EX(NCBI_ERRCODE_X_NAME(error_name), err_subcode, message); } while (0)
#define NCBI_CHECK_ERR_SUBCODE_X_NAME(name, subcode)
Issue compile-time error if error subcode given is not valid for given error code name.
Definition: ncbidiag.hpp:452
#define NCBI_ERRCODE_X_NAME(name)
Returns value of error code by its name defined by NCBI_DEFINE_ERRCODE_X.
Definition: ncbidiag.hpp:369

Definition at line 81 of file ncbidbg.hpp.

◆ _ALWAYS_TROUBLE

#define _ALWAYS_TROUBLE   NCBI_ALWAYS_TROUBLE("")

Definition at line 166 of file ncbidbg.hpp.

◆ _ALWAYS_VERIFY

#define _ALWAYS_VERIFY (   expr)    NCBI_ALWAYS_VERIFY(expr, "")

Definition at line 165 of file ncbidbg.hpp.

◆ _ASSERT

#define _ASSERT (   expr)    NCBI_ASSERT(expr, "")

Definition at line 160 of file ncbidbg.hpp.

◆ _DEBUG_ARG

#define _DEBUG_ARG (   arg)    arg

Definition at line 134 of file ncbidbg.hpp.

◆ _DEBUG_CODE

#define _DEBUG_CODE (   code)     do { code } while ( 0 )

Definition at line 136 of file ncbidbg.hpp.

◆ _TRACE

#define _TRACE (   message)    _ALWAYS_TRACE(message)

Definition at line 122 of file ncbidbg.hpp.

◆ _TRACE_EX

#define _TRACE_EX (   err_code,
  err_subcode,
  message 
)     _ALWAYS_TRACE_EX(err_code, err_subcode, message)

Definition at line 123 of file ncbidbg.hpp.

◆ _TRACE_X

#define _TRACE_X (   err_subcode,
  message 
)    _ALWAYS_TRACE_X(err_subcode, message)

Definition at line 125 of file ncbidbg.hpp.

◆ _TRACE_XX

#define _TRACE_XX (   error_name,
  err_subcode,
  message 
)     _ALWAYS_TRACE_XX(error_name, err_subcode, message)

Definition at line 126 of file ncbidbg.hpp.

◆ _TROUBLE

#define _TROUBLE   NCBI_TROUBLE("")

Definition at line 162 of file ncbidbg.hpp.

◆ _VERIFY

#define _VERIFY (   expr)    NCBI_VERIFY(expr, "")

Definition at line 161 of file ncbidbg.hpp.

◆ CHECK_NCBI_LIBRARY_VERSION_MISMATCH

#define CHECK_NCBI_LIBRARY_VERSION_MISMATCH (   void)    MAKENAME_NCBI_LIBRARY_VERSION_MISMATCH(NCBI_DEVELOPMENT_VER)

Definition at line 333 of file ncbidbg.hpp.

◆ CHECKME_VALIDATE

#define CHECKME_VALIDATE (   condition,
  error_type 
)
Value:
do { if ( !(condition) ) \
xncbi_CCheckMe_ReportError(error_type); \
} while ( 0 )

Definition at line 197 of file ncbidbg.hpp.

◆ MAKENAME_NCBI_LIBRARY_VERSION_MISMATCH

#define MAKENAME_NCBI_LIBRARY_VERSION_MISMATCH (   a)    NAME_NCBI_LIBRARY_VERSION_MISMATCH(a)

Definition at line 332 of file ncbidbg.hpp.

◆ NAME_NCBI_LIBRARY_VERSION_MISMATCH

#define NAME_NCBI_LIBRARY_VERSION_MISMATCH (   a)    Ncbi_library_version_mismatch__Full_rebuild_to_fix_##a

Definition at line 331 of file ncbidbg.hpp.

◆ NCBI_ALWAYS_ASSERT

#define NCBI_ALWAYS_ASSERT (   expr,
  mess 
)
Value:
do { if ( !(expr) ) \
NCBI_NS_NCBI::CNcbiDiag::DiagAssert(DIAG_COMPILE_INFO, #expr, mess); \
} while ( 0 )

Definition at line 109 of file ncbidbg.hpp.

◆ NCBI_ALWAYS_ASSERT_EXPR

#define NCBI_ALWAYS_ASSERT_EXPR (   expr,
  mess 
)     ((expr)?(void)0:NCBI_NS_NCBI::CNcbiDiag::DiagAssert(DIAG_COMPILE_INFO, #expr, mess))

Definition at line 113 of file ncbidbg.hpp.

◆ NCBI_ALWAYS_TROUBLE

#define NCBI_ALWAYS_TROUBLE (   mess)     NCBI_NS_NCBI::CNcbiDiag::DiagTrouble(DIAG_COMPILE_INFO, mess)

Definition at line 85 of file ncbidbg.hpp.

◆ NCBI_ALWAYS_VERIFY

#define NCBI_ALWAYS_VERIFY (   expr,
  mess 
)    NCBI_ALWAYS_ASSERT(expr, mess)

Definition at line 117 of file ncbidbg.hpp.

◆ NCBI_ASSERT

#define NCBI_ASSERT (   expr,
  mess 
)    NCBI_ALWAYS_ASSERT(expr, mess)

Definition at line 130 of file ncbidbg.hpp.

◆ NCBI_ASSERT_EXPR

#define NCBI_ASSERT_EXPR (   expr,
  mess 
)    NCBI_ALWAYS_ASSERT_EXPR(expr, mess)

Definition at line 131 of file ncbidbg.hpp.

◆ NCBI_TROUBLE

#define NCBI_TROUBLE (   mess)    NCBI_ALWAYS_TROUBLE(mess)

Definition at line 129 of file ncbidbg.hpp.

◆ NCBI_VERIFY

#define NCBI_VERIFY (   expr,
  mess 
)    NCBI_ALWAYS_VERIFY(expr, mess)

Definition at line 132 of file ncbidbg.hpp.

Enumeration Type Documentation

◆ ECheckMeError

Enumerator
eCheckMe_Unused 

The value has not been checked.

eCheckMe_Unset 

Invalid op with a not set value.

Definition at line 191 of file ncbidbg.hpp.

◆ EValidateAction

Which action to perform.

Specify action to be performed when expression under "xncbi_Validate(expr, ...)" evaluates to FALSE.

Enumerator
eValidate_Default 

Default action.

eValidate_Abort 

abort() if not valid

eValidate_Throw 

Throw an exception if not valid.

Definition at line 173 of file ncbidbg.hpp.

Function Documentation

◆ CCheckMe() [1/3]

template<typename TValue >
CCheckMe< TValue >::CCheckMe ( const CCheckMe< TValue > &  t)
inline

Definition at line 233 of file ncbidbg.hpp.

References t.

◆ CCheckMe() [2/3]

template<typename TValue >
CCheckMe< TValue >::CCheckMe ( const TValue &  val)
inline

Definition at line 229 of file ncbidbg.hpp.

◆ CCheckMe() [3/3]

template<typename TValue >
CCheckMe< TValue >::CCheckMe ( void  )
inline

Definition at line 225 of file ncbidbg.hpp.

◆ IsChecked()

template<typename TValue >
bool CCheckMe< TValue >::IsChecked ( void  ) const
inline

Definition at line 312 of file ncbidbg.hpp.

References CCheckMe< TValue >::m_IsChecked.

◆ Ncbi_library_version_mismatch__Full_rebuild_to_fix_NCBI_DEVELOPMENT_VER()

int Ncbi_library_version_mismatch__Full_rebuild_to_fix_NCBI_DEVELOPMENT_VER ( void  )

◆ operator TValue()

template<typename TValue >
CCheckMe< TValue >::operator TValue ( void  ) const
inline

◆ operator!=() [1/2]

template<typename TValue >
bool CCheckMe< TValue >::operator!= ( const CCheckMe< TValue > &  t) const
inline

◆ operator!=() [2/2]

template<typename TValue >
template<typename T >
bool CCheckMe< TValue >::operator!= ( const T t) const
inline

◆ operator=() [1/2]

template<typename TValue >
CCheckMe& CCheckMe< TValue >::operator= ( const CCheckMe< TValue > &  t)
inline

◆ operator=() [2/2]

template<typename TValue >
CCheckMe& CCheckMe< TValue >::operator= ( const TValue &  value)
inline

◆ operator==() [1/2]

template<typename TValue >
bool CCheckMe< TValue >::operator== ( const CCheckMe< TValue > &  t) const
inline

◆ operator==() [2/2]

template<typename TValue >
template<typename T >
bool CCheckMe< TValue >::operator== ( const T t) const
inline

◆ SetChecked()

template<typename TValue >
void CCheckMe< TValue >::SetChecked ( bool  is_checked = true) const
inline

Force-set to the "checked" state.

Definition at line 266 of file ncbidbg.hpp.

References CCheckMe< TValue >::m_IsChecked.

◆ xncbi_CCheckMe_ReportError()

void xncbi_CCheckMe_ReportError ( ECheckMeError  error)

Definition at line 87 of file ncbidbg.cpp.

References eCheckMe_Unused, and NCBI_TROUBLE.

◆ xncbi_GetValidateAction()

EValidateAction xncbi_GetValidateAction ( void  )

Get the action to be performed.

Definition at line 65 of file ncbidbg.cpp.

References eValidate_Abort, eValidate_Default, eValidate_Throw, and s_ValidateTLS.

Referenced by CNcbiDiag::DiagValidate().

◆ xncbi_SetValidateAction()

void xncbi_SetValidateAction ( EValidateAction  action)

Set the action to be performed.

Definition at line 59 of file ncbidbg.cpp.

References s_ValidateTLS.

◆ ~CCheckMe()

template<typename TValue >
CCheckMe< TValue >::~CCheckMe ( void  )
inline

Definition at line 240 of file ncbidbg.hpp.

References CHECKME_VALIDATE, eCheckMe_Unused, and CCheckMe< TValue >::m_IsChecked.

Variable Documentation

◆ m_IsChecked

template<typename TValue >
bool CCheckMe< TValue >::m_IsChecked
mutableprivate

◆ m_IsSet

template<typename TValue >
bool CCheckMe< TValue >::m_IsSet
private

◆ m_Value

template<typename TValue >
TValue CCheckMe< TValue >::m_Value
private

◆ s__check_ncbi_library_version_mismatch

Definition at line 336 of file ncbidbg.hpp.

Modified on Fri Dec 08 08:20:59 2023 by modify_doxy.py rev. 669887