40 #ifndef __OPENNI_EXCEPTION__
41 #define __OPENNI_EXCEPTION__
51 #if defined _WIN32 && defined _MSC_VER && !defined __PRETTY_FUNCTION__
52 #define __PRETTY_FUNCTION__ __FUNCTION__
56 #define THROW_OPENNI_EXCEPTION(format,...) throwOpenNIException( __PRETTY_FUNCTION__, __FILE__, __LINE__, format , ##__VA_ARGS__ )
59 namespace openni_wrapper
68 class OpenNIException :
public std::exception
79 OpenNIException (
const std::string& function_name,
const std::string& file_name,
unsigned line_number,
const std::string& message)
throw ();
84 virtual ~OpenNIException () throw ();
91 OpenNIException & operator= (const OpenNIException& exception) throw ();
97 virtual const
char* what () const throw ();
102 const std::
string& getFunctionName () const throw ();
107 const std::
string& getFileName () const throw ();
112 unsigned getLineNumber () const throw ();
114 std::
string function_name_;
115 std::
string file_name_;
116 unsigned line_number_;
117 std::
string message_;
118 std::
string message_long_;
130 throwOpenNIException (const
char* function_name, const
char* file_name,
unsigned line_number, const
char*
format, ...)
132 static char msg[1024];
134 va_start (args, format);
135 vsprintf (msg, format, args);
136 throw OpenNIException (function_name, file_name, line_number, msg);