pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
Exception.h
1#ifndef PFLIB_EXCEPTION_H_
2#define PFLIB_EXCEPTION_H_
3
4#include <exception>
5#include <string>
6
7namespace pflib {
8
12class Exception : public std::exception {
13 public:
19 Exception() throw() {}
20
36
40 virtual ~Exception() throw() {}
41
46 const std::string &name() const throw() { return name_; }
47
52 const std::string &message() const throw() { return message_; }
53
58 const std::string &module() const throw() { return module_; }
59
64 const std::string &function() const throw() { return function_; }
65
70 int line() const throw() { return line_; }
71
76 virtual const char *what() const throw() { return message_.c_str(); }
77
78 private:
81
84
87
90
92 int line_{0};
93};
94
95} // namespace pflib
96
106#define PFEXCEPTION_RAISE(EXCEPTION, MSG) \
107 throw pflib::Exception(EXCEPTION, MSG, __FILE__, __LINE__, __FUNCTION__)
108
109#endif // PFLIB_EXCEPTION_H_
T c_str(T... args)
PFlib.
Definition Exception.h:12
const std::string & module() const
Get the source filename where the exception occurred.
Definition Exception.h:58
std::string name_
Exception name.
Definition Exception.h:80
std::string message_
Error message.
Definition Exception.h:83
const std::string & function() const
Get the function name where the exception occurred.
Definition Exception.h:64
int line_
Source line number where the exception occurred.
Definition Exception.h:92
int line() const
Get the source line number where the exception occurred.
Definition Exception.h:70
std::string module_
Source filename where the exception occurred.
Definition Exception.h:86
const std::string & message() const
Get the message of the exception.
Definition Exception.h:52
Exception()
Empty constructor.
Definition Exception.h:19
virtual const char * what() const
The error message.
Definition Exception.h:76
virtual ~Exception()
Class destructor.
Definition Exception.h:40
Exception(const std::string &name, const std::string &message, const std::string &module, int line, const std::string &function)
Class constructor.
Definition Exception.h:29
std::string function_
Function name where the exception occurred.
Definition Exception.h:89
const std::string & name() const
Get the name of the exception.
Definition Exception.h:46
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3