ALL 0.9.3
A Loadbalacing Library
Loading...
Searching...
No Matches
ALL::CustomException Struct Reference

Customized exceptions for ALL, modified for each specific exception type. More...

#include <ALL_CustomExceptions.hpp>

+ Inheritance diagram for ALL::CustomException:
+ Collaboration diagram for ALL::CustomException:

Public Member Functions

 CustomException (const char *file_="", const char *f_="", int l_=-1, const char *i_="", const char *loc_desc_="ALLCustomException", const ErrorID error_id_=ErrorID::Generic)
 
int get_error_id ()
 
const char * get_func () const
 
const char * get_info ()
 
int get_line () const
 
virtual const char * what () const throw ()
 

Protected Types

enum struct  ErrorID : int {
  Generic = 1 , PointDimensionMissmatch , InvalidCommType , InvalidArgument ,
  OutOfBounds , InternalError , FilesystemError
}
 

Protected Attributes

ErrorID error_id
 error identificator retrieved by Fortran
 
std::string error_msg
 error message
 
const char * file
 file the exception occured in
 
const char * func
 function the exception occured in
 
const char * info
 information on the exception
 
int line
 line the exception occured in
 
const char * loc_desc
 name of the exception
 

Detailed Description

Customized exceptions for ALL, modified for each specific exception type.

Definition at line 41 of file ALL_CustomExceptions.hpp.

Member Enumeration Documentation

◆ ErrorID

enum struct ALL::CustomException::ErrorID : int
strongprotected

error identificators for Fortran error retrieval, remember to update the Fortran module as well!

Enumerator
Generic 
PointDimensionMissmatch 
InvalidCommType 
InvalidArgument 
OutOfBounds 
InternalError 
FilesystemError 

Definition at line 57 of file ALL_CustomExceptions.hpp.

Constructor & Destructor Documentation

◆ CustomException()

ALL::CustomException::CustomException ( const char * file_ = "",
const char * f_ = "",
int l_ = -1,
const char * i_ = "",
const char * loc_desc_ = "ALLCustomException",
const ErrorID error_id_ = ErrorID::Generic )
inline

constructor for an exception used in ALL

Parameters
filethe source file from where the exception is thrown
f_the function from where the exception is thrown
l_the line from where the exception is thrown
i_additional information about the error
loc_descinternal description of the exception type

Definition at line 76 of file ALL_CustomExceptions.hpp.

+ Here is the caller graph for this function:

Member Function Documentation

◆ get_error_id()

int ALL::CustomException::get_error_id ( )
inline

retrieve error id for Fortran interface

Returns
error id from ErrorID enum

Definition at line 107 of file ALL_CustomExceptions.hpp.

◆ get_func()

const char * ALL::CustomException::get_func ( ) const
inline

method to get the function name from where the exception was thrown

Returns
the function name

Definition at line 90 of file ALL_CustomExceptions.hpp.

◆ get_info()

const char * ALL::CustomException::get_info ( )
inline

method to get the additional information about the error leading to the exception

Returns
the information given about the error

Definition at line 99 of file ALL_CustomExceptions.hpp.

◆ get_line()

int ALL::CustomException::get_line ( ) const
inline

method to get the line from where the exception was thrown

Returns
the line

Definition at line 94 of file ALL_CustomExceptions.hpp.

◆ what()

virtual const char * ALL::CustomException::what ( ) const
throw ( )
inlinevirtual

overloaded method from the base Exception class to return an error message

Returns
the error message of the exception

Definition at line 103 of file ALL_CustomExceptions.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ error_id

ErrorID ALL::CustomException::error_id
protected

error identificator retrieved by Fortran

Definition at line 67 of file ALL_CustomExceptions.hpp.

◆ error_msg

std::string ALL::CustomException::error_msg
protected

error message

Definition at line 54 of file ALL_CustomExceptions.hpp.

◆ file

const char* ALL::CustomException::file
protected

file the exception occured in

Definition at line 44 of file ALL_CustomExceptions.hpp.

◆ func

const char* ALL::CustomException::func
protected

function the exception occured in

Definition at line 46 of file ALL_CustomExceptions.hpp.

◆ info

const char* ALL::CustomException::info
protected

information on the exception

Definition at line 50 of file ALL_CustomExceptions.hpp.

◆ line

int ALL::CustomException::line
protected

line the exception occured in

Definition at line 48 of file ALL_CustomExceptions.hpp.

◆ loc_desc

const char* ALL::CustomException::loc_desc
protected

name of the exception

Definition at line 52 of file ALL_CustomExceptions.hpp.


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