roadrunner  2.6.0
Fast simulator for SBML models
LLVMException.h
1 /*
2  * LLVMException.h
3  *
4  * Created on: Jun 30, 2013
5  * Author: andy
6  */
7 
8 #ifndef RRLLVMEXCEPTION_H_
9 #define RRLLVMEXCEPTION_H_
10 
11 #include <stdexcept>
12 #include "rrLogger.h"
13 #include "rrOSSpecifics.h"
14 
15 namespace rrllvm
16 {
19  class LLVMException : public std::runtime_error
20  {
21  public:
22  explicit LLVMException(const std::string& what) :
23  std::runtime_error(what)
24  {
25  }
26 
27  explicit LLVMException(const std::string& what, const std::string& where) :
28  std::runtime_error(what + ", at " + where)
29  {
30  }
31  };
32 
33 #define throw_llvm_exception(what) \
34  { \
35  rrLog(rr::Logger::LOG_INFORMATION) << "LLVMException, what: " \
36  << what << ", where: " << __FUNC__; \
37  throw LLVMException(what, __FUNC__); \
38  }
39 
41 }
42 
43 #endif /* RRLLVMEXCEPTION_H_ */