The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
mha_error.hh File Reference

Classes

class  MHA_Error
 Error reporting exception class. More...
 

Namespaces

 mha_error_helpers
 

Macros

#define Getmsg(e)   ((e).get_msg())
 
#define MHA_ErrorMsg(x)   MHA_Error(__FILE__,__LINE__,"%s",x)
 Throw an openMHA error with a text message. More...
 
#define MHA_assert(x)   if(!(x)) throw MHA_Error(__FILE__,__LINE__,"\"%s\" is false.",#x)
 Assertion macro, which throws an MHA_Error. More...
 
#define MHA_assert_equal(a, b)   if( a != b ) throw MHA_Error(__FILE__,__LINE__,"\"%s == %s\" is false (%s = %g, %s = %g).",#a,#b,#a,(double)(a),#b,(double)(b))
 Equality assertion macro, which throws an MHA_Error with the values. More...
 

Functions

void mha_debug (const char *fmt,...) __attribute__((__format__(printf
 Print an info message (stderr on Linux, OutputDebugString in Windows). More...
 
unsigned mha_error_helpers::digits (unsigned n)
 Compute number of decimal digits required to represent an unsigned integer. More...
 
unsigned mha_error_helpers::snprintf_required_length (const char *formatstring,...)
 snprintf_required_length Compute the number of bytes (excluding the terminating nul) required to store the result of an snprintf. More...
 

Macro Definition Documentation

◆ Getmsg

#define Getmsg (   e)    ((e).get_msg())