树  0.1
数据结构_第6章
Tree::TreeException Class Reference

#include <TreeException.hh>

Inheritance diagram for Tree::TreeException:
Collaboration diagram for Tree::TreeException:

Public Member Functions

 TreeException (const std::string &text="undefined exception", const std::string &id="undefined", const std::string &td="Generic ArgException")
 
virtual ~TreeException () noexcept
 
std::string error () const
 
std::string argId () const
 
const char * what () const noexcept
 
std::string typeDescription () const
 

Private Attributes

std::string _errorText
 
std::string _argId
 
std::string _typeDescription
 

Detailed Description

A simple class that defines and Tree exception. Should be caught whenever a Tree is created and used.

Definition at line 40 of file TreeException.hh.

Constructor & Destructor Documentation

◆ TreeException()

Tree::TreeException::TreeException ( const std::string &  text = "undefined exception",
const std::string &  id = "undefined",
const std::string &  td = "Generic ArgException" 
)
inline

Constructor.

Parameters
text- The text of the exception.
id- The text identifying the argument source.
td- Text describing the type of ArgException it is. of the exception.

Definition at line 62 of file TreeException.hh.

◆ ~TreeException()

virtual Tree::TreeException::~TreeException ( )
inlinevirtualnoexcept

Destructor.

Definition at line 73 of file TreeException.hh.

Member Function Documentation

◆ argId()

std::string Tree::TreeException::argId ( ) const
inline

Returns the argument id.

Definition at line 83 of file TreeException.hh.

◆ error()

std::string Tree::TreeException::error ( ) const
inline

Returns the error text.

Definition at line 78 of file TreeException.hh.

◆ typeDescription()

std::string Tree::TreeException::typeDescription ( ) const
inline

Returns the type of the exception. Used to explain and distinguish between different child exceptions.

Definition at line 105 of file TreeException.hh.

◆ what()

const char* Tree::TreeException::what ( ) const
inlinenoexcept

Returns the arg id and error text.

Definition at line 94 of file TreeException.hh.

Member Data Documentation

◆ _argId

std::string Tree::TreeException::_argId
private

The argument related to this exception.

Definition at line 116 of file TreeException.hh.

◆ _errorText

std::string Tree::TreeException::_errorText
private

The text of the exception message.

Definition at line 111 of file TreeException.hh.

◆ _typeDescription

std::string Tree::TreeException::_typeDescription
private

Describes the type of the exception. Used to distinguish between different child exceptions.

Definition at line 122 of file TreeException.hh.


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