HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CE_Error.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CE_Error.h ( CE Library, C++)
7  *
8  * COMMENTS: Compute Engine Error.
9  */
10 
11 #ifndef __CE_Error__
12 #define __CE_Error__
13 
14 #include "CE_API.h"
15 
16 #ifdef CE_ENABLED
17 
18 #include <UT/UT_String.h>
19 
20 /// A class derived from cl::Error that allows arbitrary error messages to
21 /// be stored with the exception.
22 class CE_API CE_Error: public cl::Error
23 {
24 public:
25  CE_Error(cl_int err, const char * errStr = NULL) :
26  cl::Error(err, NULL), myErrStr(errStr)
27  {
28  myErrStr.harden();
29  }
30 
31  ~CE_Error() throw() {}
32 
33  virtual const char * what() const throw ()
34  {
35  return myErrStr.buffer();
36  }
37 
38 private:
39  UT_String myErrStr;
40 };
41 
42 
43 #endif
44 #endif
#define CE_API
Definition: CE_API.h:10
CE_Error(cl_int err, const char *errStr=NULL)
Definition: CE_Error.h:25
~CE_Error()
Definition: CE_Error.h:31
virtual const char * what() const
Definition: CE_Error.h:33