HART  0.1.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
hart_exceptions.hpp File Reference
#include <iostream>
#include <stdexcept>
Include dependency graph for hart_exceptions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TestAssertException
 
class  IOError
 
class  StateError
 
class  SizeError
 
class  ValueError
 
class  SampleRateError
 
class  ChannelLayoutError
 
class  HartAssertException
 
class  UnsupportedError
 
class  ConfigurationError
 
class  IndexError
 

Namespaces

namespace  hart
 

Macros

#define HART_STRINGIFY(x)   HART_STRINGIFY2(x)
 
#define HART_STRINGIFY2(x)   #x
 
#define HART_LINE_STRING   HART_STRINGIFY(__LINE__)
 
#define HART_THROW(ExceptionType, message)   do { throw ExceptionType (std::string (message) + ", file: " __FILE__ ", line: " HART_LINE_STRING); } while (0)
 
#define HART_THROW_OR_RETURN(ExceptionType, message, returnValue)   do { HART_THROW (ExceptionType, message); return returnValue; } while (0)
 
#define HART_THROW_OR_RETURN_VOID(ExceptionType, message)   do { HART_THROW (ExceptionType, message); return; } while(0)
 
#define hassertfalse   HART_THROW (hart::HartAssertException, "hassertfalse failed")
 
#define hassert(condition)   if (! (condition)) { HART_THROW (hart::HartAssertException, std::string ("hassert failed:") + #condition); }
 
#define HART_WARNING(message)   std::cout << "Warning: " << message << ", file: " << __FILE__ << ", line: " << __LINE__ << std::endl
 

Macro Definition Documentation

◆ HART_STRINGIFY

#define HART_STRINGIFY (   x)    HART_STRINGIFY2(x)

Definition at line 76 of file hart_exceptions.hpp.

◆ HART_STRINGIFY2

#define HART_STRINGIFY2 (   x)    #x

Definition at line 77 of file hart_exceptions.hpp.

◆ HART_LINE_STRING

#define HART_LINE_STRING   HART_STRINGIFY(__LINE__)

Definition at line 80 of file hart_exceptions.hpp.

◆ HART_THROW

#define HART_THROW (   ExceptionType,
  message 
)    do { throw ExceptionType (std::string (message) + ", file: " __FILE__ ", line: " HART_LINE_STRING); } while (0)

Definition at line 85 of file hart_exceptions.hpp.

◆ HART_THROW_OR_RETURN

#define HART_THROW_OR_RETURN (   ExceptionType,
  message,
  returnValue 
)    do { HART_THROW (ExceptionType, message); return returnValue; } while (0)

Definition at line 88 of file hart_exceptions.hpp.

◆ HART_THROW_OR_RETURN_VOID

#define HART_THROW_OR_RETURN_VOID (   ExceptionType,
  message 
)    do { HART_THROW (ExceptionType, message); return; } while(0)

Definition at line 89 of file hart_exceptions.hpp.

◆ hassertfalse

#define hassertfalse   HART_THROW (hart::HartAssertException, "hassertfalse failed")

Definition at line 91 of file hart_exceptions.hpp.

◆ hassert

#define hassert (   condition)    if (! (condition)) { HART_THROW (hart::HartAssertException, std::string ("hassert failed:") + #condition); }

Definition at line 92 of file hart_exceptions.hpp.

◆ HART_WARNING

#define HART_WARNING (   message)    std::cout << "Warning: " << message << ", file: " << __FILE__ << ", line: " << __LINE__ << std::endl

Definition at line 94 of file hart_exceptions.hpp.