The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research

Error reporting exception class. More...

Inherits exception.

Public Member Functions

 MHA_Error (const char *file, int line, const char *fmt,...) __attribute__((__format__(printf
 Create an instance of a MHA_Error. More...
 
 MHA_Error (const MHA_Error &)
 
MHA_Erroroperator= (const MHA_Error &)
 
 ~MHA_Error () throw ()
 
const char * get_msg () const
 Return the error message without source position. More...
 
const char * get_longmsg () const
 Return the error message with source position. More...
 
const char * what () const throw ()
 overwrite std::execption::what() More...
 

Private Attributes

char * msg
 
char * longmsg
 

Detailed Description

Error reporting exception class.

This class is used for error handling in the openMHA. It is used by the openMHA kernel and by the openMHA toolbox library. Please note that exceptions should not be used accross ANSI-C interfaces. It is necessary to catch exceptions within the library.

The MHA_Error class holds source file name, line number and an error message.

Constructor & Destructor Documentation

◆ MHA_Error() [1/2]

MHA_Error::MHA_Error ( const char *  s_file,
int  l,
const char *  fmt,
  ... 
)

Create an instance of a MHA_Error.

Parameters
s_filesource file name (FILE)
lsource line (LINE)
fmtformat string for error message (as in printf)

◆ MHA_Error() [2/2]

MHA_Error::MHA_Error ( const MHA_Error p)

◆ ~MHA_Error()

MHA_Error::~MHA_Error ( )
throw (
)

Member Function Documentation

◆ operator=()

MHA_Error & MHA_Error::operator= ( const MHA_Error p)

◆ get_msg()

const char* MHA_Error::get_msg ( ) const
inline

Return the error message without source position.

◆ get_longmsg()

const char* MHA_Error::get_longmsg ( ) const
inline

Return the error message with source position.

◆ what()

const char* MHA_Error::what ( ) const
throw (
)
inline

overwrite std::execption::what()

Member Data Documentation

◆ msg

char* MHA_Error::msg
private

◆ longmsg

char* MHA_Error::longmsg
private

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