API
 
Loading...
Searching...
No Matches
Collaboration diagram for Exceptions:

Classes

class  MagAOX::xwcException
 Augments an exception with the source file and line. More...
 

Functions

 MagAOX::xwcException::xwcException ()=delete
 
 MagAOX::xwcException::xwcException (const std::string &msg, const std::source_location loc=std::source_location::current())
 Constructor.
 
 MagAOX::xwcException::xwcException (const std::string &msg, int code, const std::source_location loc=std::source_location::current())
 Constructor with code.
 
virtual const char * MagAOX::xwcException::what () const noexcept
 Get the what string.
 
const std::string & MagAOX::xwcException::message () const
 Get the message.
 
const std::string MagAOX::xwcException::file_name () const
 Get the source file.
 
int MagAOX::xwcException::line () const
 Get the source line.
 
int MagAOX::xwcException::code () const
 Get the error code.
 

Variables

std::string MagAOX::xwcException::m_what
 The full what message (message + file information).
 
std::string MagAOX::xwcException::m_message
 The explanatory message.
 
std::source_location MagAOX::xwcException::m_location
 
int MagAOX::xwcException::m_code { 0 }
 An error code (optional)
 

Detailed Description

Function Documentation

◆ xwcException() [1/3]

MagAOX::xwcException::xwcException ( )
delete

◆ xwcException() [2/3]

MagAOX::xwcException::xwcException ( const std::string &  msg,
const std::source_location  loc = std::source_location::current() 
)
inlineexplicit

Constructor.

The what() message becomes "msg (file line)".

Parameters
[in]msgthe error descriptionat message)

Definition at line 44 of file exceptions.hpp.

◆ xwcException() [3/3]

MagAOX::xwcException::xwcException ( const std::string &  msg,
int  code,
const std::source_location  loc = std::source_location::current() 
)
inline

Constructor with code.

The what() message becomes "msg (file line)".

Parameters
[in]msgthe error description (what message)
[in]codea descriptive error code
[in]loc[optional] the location of this call

Definition at line 54 of file exceptions.hpp.

◆ code()

int MagAOX::xwcException::code ( ) const
inline

Get the error code.

Returns
the value of m_code

Definition at line 103 of file exceptions.hpp.

References MagAOX::xwcException::m_code.

◆ file_name()

const std::string MagAOX::xwcException::file_name ( ) const
inline

Get the source file.

Returns
the value of m_location.file_name()

Definition at line 85 of file exceptions.hpp.

References MagAOX::xwcException::m_location.

◆ line()

int MagAOX::xwcException::line ( ) const
inline

Get the source line.

Returns
the value of m_location.line()

Definition at line 94 of file exceptions.hpp.

References MagAOX::xwcException::m_location.

◆ message()

const std::string & MagAOX::xwcException::message ( ) const
inline

Get the message.

Returns
the value of m_message

Definition at line 76 of file exceptions.hpp.

References MagAOX::xwcException::m_message.

◆ what()

virtual const char * MagAOX::xwcException::what ( ) const
inlinevirtualnoexcept

Get the what string.

Returns
the value of m_what.c_str()

Definition at line 67 of file exceptions.hpp.

References MagAOX::xwcException::m_what.

Referenced by MagAOX::logger::logMap< verboseT >::addFileListToFileMap().

Variable Documentation

◆ m_code

int MagAOX::xwcException::m_code { 0 }
protected

An error code (optional)

Definition at line 34 of file exceptions.hpp.

Referenced by MagAOX::xwcException::code().

◆ m_location

std::source_location MagAOX::xwcException::m_location
protected

Definition at line 32 of file exceptions.hpp.

Referenced by MagAOX::xwcException::file_name(), and MagAOX::xwcException::line().

◆ m_message

std::string MagAOX::xwcException::m_message
protected

The explanatory message.

Definition at line 30 of file exceptions.hpp.

Referenced by MagAOX::xwcException::message().

◆ m_what

std::string MagAOX::xwcException::m_what
protected

The full what message (message + file information).

Definition at line 28 of file exceptions.hpp.

Referenced by MagAOX::xwcException::what().