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

Search Toolkit Book for CStackTrace

#include <corelib/ncbi_stack.hpp>

Classes

struct  SStackFrameInfo
 Structure for holding stack trace data. More...
 

Public Types

typedef list< SStackFrameInfoTStack
 

Public Member Functions

 CStackTrace (const string &prefix="")
 Get and store current stack trace. More...
 
 ~CStackTrace (void)
 
 CStackTrace (const CStackTrace &stack_trace)
 
CStackTraceoperator= (const CStackTrace &stack_trace)
 
bool Empty (void) const
 Check if stack trace information is available. More...
 
const TStackGetStack (void) const
 Get the stack trace data. More...
 
const stringGetPrefix (void) const
 Get current prefix. More...
 
void SetPrefix (const string &prefix) const
 Set new prefix. More...
 
void Write (CNcbiOstream &os) const
 Write stack trace to the stream, prepend each line with the prefix. More...
 

Static Public Member Functions

static unsigned int s_GetStackTraceMaxDepth (void)
 
static void s_HonorSignalHandlingConfiguration (void)
 

Private Member Functions

void x_ExpandStackTrace (void) const
 

Private Attributes

unique_ptr< CStackTraceImplm_Impl
 
TStack m_Stack
 
string m_Prefix
 

Detailed Description

Definition at line 46 of file ncbi_stack.hpp.

Member Typedef Documentation

◆ TStack

Definition at line 78 of file ncbi_stack.hpp.

Constructor & Destructor Documentation

◆ CStackTrace() [1/2]

CStackTrace::CStackTrace ( const string prefix = "")

Get and store current stack trace.

When printing the stack trace to a stream, each line is prepended with "prefix".

Definition at line 78 of file ncbi_stack.cpp.

◆ ~CStackTrace()

CStackTrace::~CStackTrace ( void  )

Definition at line 85 of file ncbi_stack.cpp.

◆ CStackTrace() [2/2]

CStackTrace::CStackTrace ( const CStackTrace stack_trace)

Definition at line 90 of file ncbi_stack.cpp.

Member Function Documentation

◆ Empty()

bool CStackTrace::Empty ( void  ) const
inline

Check if stack trace information is available.

Definition at line 90 of file ncbi_stack.hpp.

References m_Stack, and x_ExpandStackTrace().

Referenced by CNcbiDiag::Put(), and Write().

◆ GetPrefix()

const string& CStackTrace::GetPrefix ( void  ) const
inline

Get current prefix.

Definition at line 103 of file ncbi_stack.hpp.

References m_Prefix.

◆ GetStack()

const TStack& CStackTrace::GetStack ( void  ) const
inline

Get the stack trace data.

Definition at line 97 of file ncbi_stack.hpp.

References m_Stack, and x_ExpandStackTrace().

Referenced by operator=().

◆ operator=()

CStackTrace & CStackTrace::operator= ( const CStackTrace stack_trace)

Definition at line 96 of file ncbi_stack.cpp.

References GetStack(), m_Impl, m_Prefix, and m_Stack.

◆ s_GetStackTraceMaxDepth()

unsigned int CStackTrace::s_GetStackTraceMaxDepth ( void  )
static

◆ s_HonorSignalHandlingConfiguration()

void CStackTrace::s_HonorSignalHandlingConfiguration ( void  )
static

◆ SetPrefix()

void CStackTrace::SetPrefix ( const string prefix) const
inline

Set new prefix.

Definition at line 105 of file ncbi_stack.hpp.

References m_Prefix.

Referenced by CNcbiDiag::Put().

◆ Write()

void CStackTrace::Write ( CNcbiOstream os) const

Write stack trace to the stream, prepend each line with the prefix.

Definition at line 127 of file ncbi_stack.cpp.

References Empty(), ITERATE, m_Prefix, m_Stack, NPOS, s_StackFilters, and x_ExpandStackTrace().

Referenced by CIgBlastnApp::CIgWorker::Main(), CIgBlastnApp::CIgFormatter::Main(), and operator<<().

◆ x_ExpandStackTrace()

void CStackTrace::x_ExpandStackTrace ( void  ) const
private

Definition at line 113 of file ncbi_stack.cpp.

References m_Impl, and m_Stack.

Referenced by Empty(), GetStack(), and Write().

Member Data Documentation

◆ m_Impl

unique_ptr<CStackTraceImpl> CStackTrace::m_Impl
mutableprivate

Definition at line 117 of file ncbi_stack.hpp.

Referenced by operator=(), and x_ExpandStackTrace().

◆ m_Prefix

string CStackTrace::m_Prefix
mutableprivate

Definition at line 119 of file ncbi_stack.hpp.

Referenced by GetPrefix(), operator=(), SetPrefix(), and Write().

◆ m_Stack

TStack CStackTrace::m_Stack
mutableprivate

Definition at line 118 of file ncbi_stack.hpp.

Referenced by Empty(), GetStack(), operator=(), Write(), and x_ExpandStackTrace().


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