shark::Exception Class Reference

Top-level exception class of the shark library. More...

#include <shark/Core/Exception.h>

+ Inheritance diagram for shark::Exception:

Public Member Functions

 Exception (const std::string &what="unknown reason", const std::string &file="unknown", unsigned int line=0, const std::string &func="function")
 Default c'tor. More...
 
 ~Exception () throw ()
 Default d'tor. More...
 
const char * what () const throw ()
 Accesses the description of the exception. More...
 
const std::string & file () const
 Accesses the name of the file the exception occurred in. More...
 
unsigned int line () const
 Accesses the line of the file the exception occured in. More...
 

Protected Attributes

std::string m_what
 Description of the exception. More...
 
std::string m_file
 File name the exception occurred in. More...
 
unsigned int m_line
 Line of file the exception occurred in. More...
 
std::string m_func
 Function name the exception occured in. More...
 
std::string m_message
 complete error message More...
 

Detailed Description

Top-level exception class of the shark library.

Definition at line 45 of file Exception.h.

Constructor & Destructor Documentation

◆ Exception()

shark::Exception::Exception ( const std::string &  what = "unknown reason",
const std::string &  file = "unknown",
unsigned int  line = 0,
const std::string &  func = "function" 
)
inline

Default c'tor.

Parameters
[in]whatString that describes the exception.
[in]fileFilename the function that has thrown the exception resides in.
[in]lineLine of file that has thrown the exception.
[in]funcName of the Function the error appeared in.

Definition at line 54 of file Exception.h.

References line(), m_file, m_func, m_message, and what().

◆ ~Exception()

shark::Exception::~Exception ( )
throw (
)
inline

Default d'tor.

Definition at line 70 of file Exception.h.

Member Function Documentation

◆ file()

const std::string& shark::Exception::file ( ) const
inline

Accesses the name of the file the exception occurred in.

Definition at line 82 of file Exception.h.

References m_file.

◆ line()

unsigned int shark::Exception::line ( ) const
inline

Accesses the line of the file the exception occured in.

Definition at line 89 of file Exception.h.

References m_line.

Referenced by Exception().

◆ what()

const char* shark::Exception::what ( ) const
throw (
)
inline

Accesses the description of the exception.

Definition at line 75 of file Exception.h.

References m_message.

Referenced by Exception(), and main().

Member Data Documentation

◆ m_file

std::string shark::Exception::m_file
protected

File name the exception occurred in.

Definition at line 95 of file Exception.h.

Referenced by Exception(), and file().

◆ m_func

std::string shark::Exception::m_func
protected

Function name the exception occured in.

Definition at line 97 of file Exception.h.

Referenced by Exception().

◆ m_line

unsigned int shark::Exception::m_line
protected

Line of file the exception occurred in.

Definition at line 96 of file Exception.h.

Referenced by line().

◆ m_message

std::string shark::Exception::m_message
protected

complete error message

Definition at line 98 of file Exception.h.

Referenced by Exception(), and what().

◆ m_what

std::string shark::Exception::m_what
protected

Description of the exception.

Definition at line 94 of file Exception.h.


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