00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00035 #ifndef __EXCEPTION_H__
00036 #define __EXCEPTION_H__
00037
00038 #include "../lib/common.h"
00039
00040 namespace NIDevice
00041 {
00042 namespace Core
00043 {
00046 class Exception : public std::exception
00047 {
00048 public:
00049 protected:
00050 long line;
00051 std::string typeName;
00052 std::string description;
00053 std::string source;
00054 std::string file;
00055 mutable std::string fullDesc;
00056 private:
00057
00058 public:
00062 Exception(const std::string& description, const std::string& source);
00063
00067 Exception(const std::string& description, const std::string& source, const char* type, const char* file, long line);
00068
00072 Exception(const Exception& exception);
00073
00077 ~Exception() throw();
00078
00081 void operator =(const Exception& exception);
00082
00085 virtual const std::string& GetFullDescription() const;
00086
00089 virtual const std::string& GetSource() const;
00090
00093 virtual const std::string& GetFile() const;
00094
00097 virtual long GetLine() const;
00098
00101 virtual const std::string& GetDescription() const;
00102
00105 const char* what() const throw();
00106 protected:
00107 private:
00108 };
00109
00110 class ExceptionKinect : public Exception
00111 {
00112 public:
00113 protected:
00114 private:
00115
00116 public:
00117 ExceptionKinect(const std::string& description, const std::string& source, const char* file, long line);
00118 protected:
00119 private:
00120 };
00121
00124 #define KINECT_EXCEPT(exceptionType, desc, src) throw(exceptionType(desc, src, __FILE__, __LINE__))
00125 }
00126 }
00127
00128 #endif