pxar
 All Classes Namespaces Functions Variables Typedefs Friends
exceptions.h
1 
5 #ifndef PXAR_EXCEPTIONS_H
6 #define PXAR_EXCEPTIONS_H
7 
8 #include <exception>
9 #include <string>
10 
11 namespace pxar {
12 
15  class pxarException : public std::exception {
16  public:
17  pxarException(const std::string& what_arg) : std::exception(),ErrorMessage(what_arg) {}
18  ~pxarException() throw() {};
19  virtual const char* what() const throw(){
20  return ErrorMessage.c_str();
21  };
22  private:
23  std::string ErrorMessage;
24  };
25 
31  class InvalidConfig : public pxarException {
32  public:
33  InvalidConfig(const std::string& what_arg) : pxarException(what_arg) {}
34  };
35 
40  public:
41  FirmwareVersionMismatch(const std::string& what_arg) : pxarException(what_arg) {}
42  };
43 
48  public:
49  UsbConnectionError(const std::string& what_arg) : pxarException(what_arg) {}
50  };
51 
55  public:
56  UsbConnectionTimeout(const std::string& what_arg) : pxarException(what_arg) {}
57  };
58 
62  public:
63  uint32_t numberMissing;
64  DataMissingEvent(const std::string& what_arg, uint32_t nmiss) : pxarException(what_arg), numberMissing(nmiss) {}
65  };
66 
70  public:
71  DataDecodingError(const std::string& what_arg) : pxarException(what_arg) {}
72  };
73 
78  public:
79  DataInvalidAddressError(const std::string& what_arg) : DataDecodingError(what_arg) {}
80  };
81 
86  public:
87  DataInvalidPulseheightError(const std::string& what_arg) : DataDecodingError(what_arg) {}
88  };
89 
94  public:
95  DataCorruptBufferError(const std::string& what_arg) : DataDecodingError(what_arg) {}
96  };
97 
98 } //namespace pxar
99 
100 #endif /* PXAR_EXCEPTIONS_H */