HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TfBaseException Class Reference

#include <exception.h>

+ Inheritance diagram for TfBaseException:

Public Member Functions

virtual TF_API ~TfBaseException ()
 
TF_API TfBaseException (std::string const &message)
 
TfCallContext constGetThrowContext () const
 
std::vector< uintptr_t > constGetThrowStack () const
 
void MoveThrowStackTo (std::vector< uintptr_t > &out)
 
virtual TF_API const char * what () const noexceptoverride
 

Friends

template<class Derived , class... Args>
void Tf_Throw (TfCallContext const &cc, TfSkipCallerFrames skipFrames, Args &&...args)
 

Detailed Description

The base class for exceptions supported by the Tf exceptions facilities. Typical usage is to publically derive your own exception class from this one, and throw using the TF_THROW() macro.

Deriving this base class and throwing via TF_THROW() will record the throw point's call context (see GetThrowContext()) and will also capture a portion of the throwing thread's call stack (see GetThrowStack()).

Additionally, the Tf library registers an exception translator with hboost.python to raise a Python exeption wrapping the thrown exception object. Similarly utilties that call Python via Tf will re-throw the embedded C++ exception if the Python exception unwinds back into C++.

Definition at line 63 of file exception.h.

Constructor & Destructor Documentation

virtual TF_API TfBaseException::~TfBaseException ( )
virtual
TF_API TfBaseException::TfBaseException ( std::string const message)
explicit

Construct with message, reported by this class's what() implementation.

Member Function Documentation

TfCallContext const& TfBaseException::GetThrowContext ( ) const
inline

Return the call context from the throw point associated with this exception. Note that this context may be invalid if this exception was not thrown with TF_THROW().

Definition at line 77 of file exception.h.

std::vector<uintptr_t> const& TfBaseException::GetThrowStack ( ) const
inline

Return the stack frame pointers from the throw point. See ArchPrintStackFrames() to turn these into human-readable strings.

Definition at line 83 of file exception.h.

void TfBaseException::MoveThrowStackTo ( std::vector< uintptr_t > &  out)
inline

Move the stack frame pointers from the throw point to out. See GetThrowStack() for more details.

Definition at line 89 of file exception.h.

virtual TF_API const char* TfBaseException::what ( ) const
overridevirtualnoexcept

Override std::exception::what() to return the message passed during construction.

Friends And Related Function Documentation

template<class Derived , class... Args>
void Tf_Throw ( TfCallContext const cc,
TfSkipCallerFrames  skipFrames,
Args &&...  args 
)
friend

Definition at line 121 of file exception.h.


The documentation for this class was generated from the following file: