NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CNcbiDiag Class Reference

Search Toolkit Book for CNcbiDiag

CNcbiDiag –. More...

#include <corelib/ncbidiag.hpp>

+ Collaboration diagram for CNcbiDiag:

Public Types

typedef const CNcbiDiag &(* FManip) (const CNcbiDiag &)
 Diagnostic stream manipulator. More...
 
typedef IOS_BASE &(* FIosbaseManip) (IOS_BASE &)
 
typedef CNcbiIos &(* FIosManip) (CNcbiIos &)
 

Public Member Functions

 CNcbiDiag (EDiagSev sev=eDiag_Error, TDiagPostFlags post_flags=eDPF_Default)
 Constructor. More...
 
 CNcbiDiag (const CDiagCompileInfo &info, EDiagSev sev=eDiag_Error, TDiagPostFlags post_flags=eDPF_Default)
 Constructor – includes the file and line number info. More...
 
 ~CNcbiDiag (void)
 Destructor. More...
 
const CNcbiDiagGetRef (void) const
 Some compilers (e.g. More...
 
template<class X >
const CNcbiDiagPut (const volatile void *, const X &x) const
 Generic method to post to diagnostic stream. More...
 
const CNcbiDiagPut (const ErrCode *, const ErrCode &err_code) const
 Helper method to post error code and subcode to diagnostic stream. More...
 
const CNcbiDiagPut (const Severity *, const Severity &severity) const
 Helper method to set severity level. More...
 
template<class X >
const CNcbiDiagPut (const CException *, const X &x) const
 Helper method to post an exception to diagnostic stream. More...
 
template<class X >
const CNcbiDiagPut (const exception *, const X &x) const
 
const CNcbiDiagPut (const CStackTrace *, const CStackTrace &stacktrace) const
 Helper method to post stack trace to diagnostic stream using standard stack trace formatting. More...
 
const CNcbiDiagPut (const NCBI_NS_NCBI::SetPostFlags *, const NCBI_NS_NCBI::SetPostFlags &flags) const
 Helper method to set specific post flags. More...
 
const CNcbiDiagPut (const FManip, const FManip &manip) const
 Helper method to handle various diagnostic stream manipulators. More...
 
const CNcbiDiagoperator<< (FManip manip) const
 
const CNcbiDiagoperator<< (FIosbaseManip manip) const
 
const CNcbiDiagoperator<< (FIosManip manip) const
 
template<class X >
const CNcbiDiagoperator<< (const X &x) const
 Post the arguments. More...
 
const CNcbiDiagSetFile (const char *file) const
 Set file name to post. More...
 
const CNcbiDiagSetModule (const char *module) const
 Set module name. More...
 
const CNcbiDiagSetClass (const char *nclass) const
 Set class name. More...
 
const CNcbiDiagSetFunction (const char *function) const
 Set function name. More...
 
const CNcbiDiagSetLine (size_t line) const
 Set line number for post. More...
 
const CNcbiDiagSetErrorCode (int code=0, int subcode=0) const
 Set error code and subcode numbers. More...
 
EDiagSev GetSeverity (void) const
 Get severity of the current message. More...
 
const char * GetFile (void) const
 Get file used for the current message. More...
 
size_t GetLine (void) const
 Get line number for the current message. More...
 
int GetErrorCode (void) const
 Get error code of the current message. More...
 
int GetErrorSubCode (void) const
 Get error subcode of the current message. More...
 
const char * GetModule (void) const
 Get module name of the current message. More...
 
const char * GetClass (void) const
 Get class name of the current message. More...
 
const char * GetFunction (void) const
 Get function name of the current message. More...
 
bool CheckFilters (const CException *ex=NULL) const
 Check if filters are passed for the current message. More...
 
TDiagPostFlags GetPostFlags (void) const
 Get post flags for the current message. More...
 
void SetAllPostFlags (TDiagPostFlags flags) const
 Set new post flags for the current message. More...
 
TDiagPostFlags SetPostFlags (TDiagPostFlags flags) const
 Set specific post flags for the current message. More...
 
TDiagPostFlags ResetPostFlags (TDiagPostFlags flags) const
 Clear specific post flags for the current message. More...
 
void ResetIsMessageFlag (void) const
 
void ResetIsNoteFlag (void) const
 Reset IsNote flag. More...
 
void ResetIsConsoleFlag (void) const
 Reset IsConsole flag. More...
 
bool GetOmitStackTrace (void) const
 
void SetOmitStackTrace (bool value)
 
template<>
const CNcbiDiagoperator<< (const char *const &x) const
 

Static Public Member Functions

static const char * SeverityName (EDiagSev sev)
 Get a common symbolic name for the severity levels. More...
 
static bool StrToSeverityLevel (const char *str_sev, EDiagSev &sev)
 Get severity from string. More...
 
static NCBI_XNCBI_EXPORT void DiagFatal (const CDiagCompileInfo &info, const char *message)
 Display fatal error message. More...
 
static void DiagTrouble (const CDiagCompileInfo &info, const char *message=NULL)
 Display trouble error message. More...
 
static NCBI_XNCBI_EXPORT void DiagAssert (const CDiagCompileInfo &info, const char *expression, const char *message=NULL)
 Assert specified expression and report results. More...
 
static void DiagAssertIfSuppressedSystemMessageBox (const CDiagCompileInfo &info, const char *expression, const char *message=NULL)
 Same as DiagAssert but only if the system message box is suppressed. More...
 
static void DiagValidate (const CDiagCompileInfo &info, const char *expression, const char *message)
 Display validation message. More...
 
static TDiagPostFlags ForceImportantFlags (TDiagPostFlags flags)
 Set important flags to their globally set values. More...
 

Private Member Functions

void x_EndMess (void) const
 Private replacement for Endm called from manipulators. More...
 
const CNcbiDiagx_Put (const CException &ex) const
 Helper func for the exception-related Put() More...
 
 CNcbiDiag (const CNcbiDiag &)
 Private copy constructor to prohibit copy. More...
 
CNcbiDiagoperator= (const CNcbiDiag &)
 Private assignment operator to prohibit assignment. More...
 

Private Attributes

EDiagSev m_Severity
 Severity level of current msg. More...
 
int m_ErrCode
 Error code. More...
 
int m_ErrSubCode
 Error subcode. More...
 
CDiagBuffer & m_Buffer
 This thread's error msg. buffer. More...
 
TDiagPostFlags m_PostFlags
 Bitwise OR of "EDiagPostFlag". More...
 
bool m_OmitStackTrace
 
CDiagCompileInfo m_CompileInfo
 

Friends

const CNcbiDiagReset (const CNcbiDiag &diag)
 Reset the content of current message. More...
 
const CNcbiDiagEndm (const CNcbiDiag &diag)
 Flush current message, start new one. More...
 
const CNcbiDiagInfo (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to INFO. More...
 
const CNcbiDiagWarning (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to WARNING. More...
 
const CNcbiDiagError (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to ERROR. More...
 
const CNcbiDiagCritical (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to CRITICAL ERROR. More...
 
const CNcbiDiagFatal (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to FATAL. More...
 
const CNcbiDiagTrace (const CNcbiDiag &diag)
 Flush current message, then set a severity for the next diagnostic message to TRACE. More...
 
const CNcbiDiagMessage (const CNcbiDiag &diag)
 Set IsMessage flag to indicate that the current post is a message. More...
 
const CNcbiDiagNote (const CNcbiDiag &diag)
 Set IsNote flag to indicate that the current post is a note. More...
 
const CNcbiDiagConsole (const CNcbiDiag &diag)
 Set IsConsole flag to indicate that the current post should go to console regardless of its severity (in addition to the default output – file etc.). More...
 
const CNcbiDiagStackTrace (const CNcbiDiag &diag)
 Print stack trace. More...
 

Detailed Description

CNcbiDiag –.

Define the main NCBI Diagnostic class.

Definition at line 923 of file ncbidiag.hpp.


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:06 2024 by modify_doxy.py rev. 669887