41 #ifndef CRL_MULTISENSE_EXCEPTION_HH 42 #define CRL_MULTISENSE_EXCEPTION_HH 53 #define CRL_FILENAME \ 54 (strrchr(__FILE__,'\\') \ 55 ? strrchr(__FILE__,'\\')+1 \ 58 #define CRL_FILENAME \ 59 (strrchr(__FILE__,'/') \ 60 ? strrchr(__FILE__,'/')+1 \ 64 #ifdef CRL_DEBUG_SYSLOG 66 #define CRL_DEBUG_REDIRECTION syslog(LOG_USER|LOG_INFO, 68 #define CRL_DEBUG_REDIRECTION fprintf(stderr, 69 #endif // CRL_DEBUG_SYSLOG 71 #define CRL_DEBUG(fmt, ...) \ 73 double now = crl::multisense::details::utility::TimeStamp::getCurrentTime().getNanoSeconds() * 1e-9; \ 74 CRL_DEBUG_REDIRECTION "[%.3f] %s(%d): %s: " fmt,now,CRL_FILENAME,__LINE__, \ 75 CRL_PRETTY_FUNCTION,##__VA_ARGS__); \ 78 #define CRL_DEBUG_RAW(fmt) \ 80 double now = crl::multisense::details::utility::TimeStamp::getCurrentTime().getNanoSeconds() * 1e-9; \ 81 CRL_DEBUG_REDIRECTION "[%.3f] %s(%d): %s: " fmt,now,CRL_FILENAME,__LINE__, \ 82 CRL_PRETTY_FUNCTION); \ 85 #define CRL_EXCEPTION(fmt, ...) \ 87 throw crl::multisense::details::utility::Exception("%s(%d): %s: " fmt,CRL_FILENAME,__LINE__, \ 88 CRL_PRETTY_FUNCTION,##__VA_ARGS__); \ 91 #define CRL_EXCEPTION_RAW(fmt) \ 93 throw crl::multisense::details::utility::Exception("%s(%d): %s: " fmt,CRL_FILENAME,__LINE__, \ 94 CRL_PRETTY_FUNCTION); \ 98 namespace multisense {
110 Exception(
const char *failureReason, ...);
111 Exception(
const std::string& failureReason);
114 virtual const
char*
what() const throw();
virtual const char * what() const
Exception(const char *failureReason,...)