libexcept: libexcept::exception_base_t Class Reference

libexcept::exception_base_t Class Reference

#include <exception.h>

Inheritance diagram for libexcept::exception_base_t:
Public Member Functions  exception_base_t (int const stack_trace_depth=STACK_TRACE_DEPTH)  Initialize this Snap! exception. More...
  virtual ~exception_base_t ()  Destructor of the exception base class. More...
  stack_trace_t const & get_stack_trace () const  Retrieve the stack trace. More...
  Private Attributes stack_trace_t f_stack_trace = stack_trace_t()  The variable where the exception stack trace gets saved. More...
  Detailed Description

Definition at line 67 of file exception.h.

Constructor & Destructor Documentation
libexcept::exception_base_t::exception_base_t ( int const  stack_trace_depth = STACK_TRACE_DEPTH) explicit

Initialize the base exception class by generating the output of a stack trace to a list of strings.

At this time every single exception derived from exception_t generates a stack trace. Note that in most cases, our philosophy is to generate exceptions only in very exceptional cases and not on every single error so the event should be rare in a normal run of our daemons.
[in]stack_trace_depthThe number of lines to grab in our stack trace.
See also

Definition at line 573 of file exception.cpp.

References libexcept::collect_stack_trace(), f_stack_trace, and libexcept::anonymous_namespace{exception.cpp}::g_collect_stack.

libexcept::exception_base_t::~exception_base_t ( ) inlinevirtual

This destructor is defined to ease derivation when some of the classes have virtual functions.

Definition at line 72 of file exception.h.

Member Function Documentation
libexcept::exception_base_t::get_stack_trace ( ) const inline

This function retreives a reference to the vector of strings representing the stack trace at the time the exception was raised.

Definition at line 74 of file exception.h.

References f_stack_trace.

Member Data Documentation
stack_trace_t libexcept::exception_base_t::f_stack_trace = stack_trace_t() private

This parameter holds the vector of strings representing the stack trace at the time an exception was raised and an instance of the exception_base_t class was created.

Definition at line 77 of file exception.h.

Referenced by exception_base_t(), and get_stack_trace().

The documentation for this class was generated from the following files:
  • /home/snapwebsites/snapcpp/contrib/libexcept/src/exception.h
  • /home/snapwebsites/snapcpp/contrib/libexcept/src/exception.cpp

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly