mpqc::detail::Backtrace Class Reference

Documentation

Creates a backtrace of a running program/thread. Example of use:

void make_omelet(int num_eggs) {
if (num_eggs < 1) {
mpqc::detail::Backtrace bt("breakfast fail:");
throw std::runtime_error(bt.str());
}
stove.on();
// etc.
}

Public Member Functions

 Backtrace (const std::string &prefix=std::string(""))
 
 Backtrace (const Backtrace &)
 
bool empty () const
 
std::string str (const size_t nframes_to_skip=0) const
 

Constructor & Destructor Documentation

◆ Backtrace() [1/2]

mpqc::detail::Backtrace::Backtrace ( const std::string &  prefix = std::string(""))
Parameters
prefixwill be prepended to each line

◆ Backtrace() [2/2]

mpqc::detail::Backtrace::Backtrace ( const Backtrace other)

Member Function Documentation

◆ empty()

bool mpqc::detail::Backtrace::empty ( ) const
inline
Returns
true if did not get a backtrace

◆ str()

std::string mpqc::detail::Backtrace::str ( const size_t  nframes_to_skip = 0) const

converts to a string

Parameters
nframes_to_skiphow many frames to skip
Returns
string representation of Backtrace, with each frame on a separate line, from bottom to top

The documentation for this class was generated from the following files:
Definition: backtrace.h:50