lxgui
Public Member Functions | Protected Attributes | List of all members
lxgui::utils::exception Class Reference

Exception class. More...

#include <utils_exception.hpp>

Inheritance diagram for lxgui::utils::exception:
lxgui::gui::exception

Public Member Functions

 exception ()=default
 Default exception. More...
 
 exception (const exception &other)=default
 Copy constructor. More...
 
 exception (const std::string &message)
 Simple message exception. More...
 
 exception (const std::string &class_name, const std::string &message)
 Class name + message exception. More...
 
const std::string & get_description () const
 Returns the message of the exception. More...
 
const char * what () const noexcept override
 Override std::exception::what() More...
 

Protected Attributes

std::string message_ = "Undefined exception."
 

Detailed Description

Exception class.

Definition at line 12 of file utils_exception.hpp.

Constructor & Destructor Documentation

◆ exception() [1/4]

lxgui::utils::exception::exception ( )
default

Default exception.

Note
Reports: "Undefined exception."

◆ exception() [2/4]

lxgui::utils::exception::exception ( const exception other)
default

Copy constructor.

◆ exception() [3/4]

lxgui::utils::exception::exception ( const std::string &  message)
explicit

Simple message exception.

Parameters
messageThe message to throw
Note
Reports: "<message>"

Definition at line 5 of file utils_exception.cpp.

◆ exception() [4/4]

lxgui::utils::exception::exception ( const std::string &  class_name,
const std::string &  message 
)

Class name + message exception.

Parameters
class_nameThe name of the class which throws the exception
messageThe message to throw
Note
Reports: "<class_name>: <message>"

Definition at line 7 of file utils_exception.cpp.

Member Function Documentation

◆ get_description()

const std::string & lxgui::utils::exception::get_description ( ) const

Returns the message of the exception.

Returns
The message of the exception

Definition at line 10 of file utils_exception.cpp.

◆ what()

const char * lxgui::utils::exception::what ( ) const
overridenoexcept

Override std::exception::what()

Returns
The message of the exception

Definition at line 14 of file utils_exception.cpp.

Member Data Documentation

◆ message_

std::string lxgui::utils::exception::message_ = "Undefined exception."
protected

Definition at line 51 of file utils_exception.hpp.


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