栈  0.1
数据结构_第3章
RPN::RpnException Class Reference

异常类 More...

#include <Rpn.hh>

Inheritance diagram for RPN::RpnException:
[legend]
Collaboration diagram for RPN::RpnException:
[legend]

Public Member Functions

 RpnException (const std::string &text="undefined exception", const std::string &id="undefined", const std::string &td="Generic ArgException")
 Constructor. More...
 
virtual ~RpnException () noexcept
 Destroy the Rpn Exception object. More...
 
std::string error () const
 Returns the error text. More...
 
std::string argId () const
 Returns the argument id. More...
 
const char * what () const noexcept
 Returns the arg id and error text. More...
 
std::string typeDescription () const
 

Private Attributes

std::string _errorText
 The text of the exception message. More...
 
std::string _argId
 The argument related to this exception. More...
 
std::string _typeDescription
 Describes the type of the exception.
More...
 

Detailed Description

异常类

Definition at line 44 of file Rpn.hh.

Constructor & Destructor Documentation

◆ RpnException()

RPN::RpnException::RpnException ( 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 54 of file Rpn.hh.

◆ ~RpnException()

virtual RPN::RpnException::~RpnException ( )
inlinevirtualnoexcept

Destroy the Rpn Exception object.

Definition at line 66 of file Rpn.hh.

Member Function Documentation

◆ argId()

std::string RPN::RpnException::argId ( ) const
inline

Returns the argument id.

Returns
std::string

Definition at line 80 of file Rpn.hh.

References _argId.

◆ error()

std::string RPN::RpnException::error ( ) const
inline

Returns the error text.

Returns
std::string

Definition at line 73 of file Rpn.hh.

References _errorText.

◆ typeDescription()

std::string RPN::RpnException::typeDescription ( ) const
inline

@ brief Returns the type of the exception.

Used to explain and distinguish between different child exceptions.

Definition at line 104 of file Rpn.hh.

References _typeDescription.

◆ what()

const char* RPN::RpnException::what ( ) const
inlinenoexcept

Returns the arg id and error text.

Definition at line 91 of file Rpn.hh.

References _argId, and _errorText.

Member Data Documentation

◆ _argId

std::string RPN::RpnException::_argId
private

The argument related to this exception.

Definition at line 115 of file Rpn.hh.

Referenced by argId(), and what().

◆ _errorText

std::string RPN::RpnException::_errorText
private

The text of the exception message.

Definition at line 110 of file Rpn.hh.

Referenced by error(), and what().

◆ _typeDescription

std::string RPN::RpnException::_typeDescription
private

Describes the type of the exception.

Used to distinguish between different child exceptions.

Definition at line 123 of file Rpn.hh.

Referenced by typeDescription().


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