dmlite  0.6
exceptions.h
Go to the documentation of this file.
1 /// @file include/dmlite/cpp/exceptions.h
2 /// @brief Exceptions used by the API
3 /// @author Alejandro Álvarez Ayllón <aalvarez@cern.ch>
4 #ifndef DMLITE_CPP_EXCEPTIONS_H
5 #define DMLITE_CPP_EXCEPTIONS_H
6 
7 #include "dmlite/common/config.h"
8 #include "dmlite/common/errno.h"
9 
10 #include <cstdarg>
11 #include <exception>
12 #include <string>
13 
14 namespace dmlite {
15 
16 /// Base exception class
17 class DmException: public std::exception {
18 public:
19  DmException();
20  DmException(int code);
21  DmException(int code, const std::string &string);
22  DmException(int code, const char* fmt, va_list args);
23  DmException(int code, const char* fmt, ...);
24 
25  DmException(const DmException &de);
26 
27  virtual ~DmException() throw();
28 
29  int code() const throw();
30  const char* what() const throw();
31 
32 protected:
34  std::string errorMsg_;
35 
36  void setMessage(const char* fmt, va_list args);
37 };
38 
39 };
40 
41 #endif // DMLITE_CPP_EXCEPTIONS_H
Error codes.
Header generated by CMake with the build configuration used.
Base exception class.
Definition: exceptions.h:17
int errorCode_
Definition: exceptions.h:33
void setMessage(const char *fmt, va_list args)
int code() const
const char * what() const
std::string errorMsg_
Definition: exceptions.h:34
virtual ~DmException()