/[ascend]/trunk/pygtk/interface/reporter.h
ViewVC logotype

Contents of /trunk/pygtk/interface/reporter.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 507 - (show annotations) (download) (as text)
Wed Apr 19 02:44:25 2006 UTC (13 years, 9 months ago) by johnpye
File MIME type: text/x-chdr
File size: 1342 byte(s)
Fixing for ubuntu GCC 4
1 #ifndef ASCXX_REPORTER_H
2 #define ASCXX_REPORTER_H
3
4 #include "config.h"
5
6 extern "C"{
7 #include <utilities/error.h>
8 }
9
10 #ifdef ASCXX_USE_PYTHON
11 # include <Python.h>
12 #endif
13
14 /**
15 This class provides C++ abstraction of the error.h error callback
16 interface.
17
18 Initially, it's trying to just handling the conveying of error
19 messages back to python, but it could be used to pass back
20 all sorts of other 'messages' eventually.
21
22 Maybe raising alerts, notifying of the progress of big tasks, etc.
23
24 The client_data pointer allows callback context to be set. This will
25 be used to specify which Python function should be used for error
26 reporting, in the case of the Python extension to this class.
27 */
28 class Reporter{
29 private:
30 void *client_data;
31 Reporter(); // This class will be a singleton
32 ~Reporter();
33 static Reporter *_instance;
34 #ifdef ASCXX_USE_PYTHON
35 bool is_python;
36 #endif
37
38 public:
39 static Reporter *Instance();
40 void setErrorCallback(error_reporter_callback_t, void *client_data=NULL);
41
42 #ifdef ASCXX_USE_PYTHON
43 void setPythonErrorCallback(PyObject *pyfunc);
44 void clearPythonErrorCallback();
45 int reportErrorPython(ERROR_REPORTER_CALLBACK_ARGS);
46 #endif
47
48 };
49
50 Reporter *getReporter();
51
52 #ifdef ASCXX_USE_PYTHON
53 // Python-invoking callback function
54 int reporter_error_python(ERROR_REPORTER_CALLBACK_ARGS);
55 #endif
56
57 #endif // ASCXX_REPORTER_H

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22