Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef NIFTI_CAMERA_CAMERAEXCEPTION_H_
00009 #define NIFTI_CAMERA_CAMERAEXCEPTION_H_
00010
00011 #define CAMERA_EXCEPTION(err, message) \
00012 do { \
00013 if ((err>0)||(err<=-DC1394_ERROR_NUM)) \
00014 err=DC1394_INVALID_ERROR_CODE; \
00015 \
00016 if (err!=DC1394_SUCCESS) { \
00017 dc1394_log_error("%s: in %s (%s, line %d): %s\n", \
00018 dc1394_error_get_string(err), \
00019 __FUNCTION__, __FILE__, __LINE__, message); \
00020 throw nifti::dc1394::CameraException(err, message); \
00021 } \
00022 } while (0);
00023
00024 #include <stdexcept>
00025 #include <string>
00026
00027 #include <dc1394/dc1394.h>
00028
00029 namespace nifti {
00030 namespace dc1394 {
00031
00035 class CameraException: public std::runtime_error {
00036
00037 public:
00042 CameraException(dc1394error_t error, std::string message);
00043 CameraException();
00044 virtual ~CameraException() throw ();
00045
00046 dc1394error_t getError();
00047 std::string getErrorString();
00048
00049 private:
00050 dc1394error_t error;
00051
00052 };
00053
00054 }
00055 }
00056
00057 #endif