/[ascend]/trunk/pygtk/registry.cpp
ViewVC logotype

Contents of /trunk/pygtk/registry.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 875 - (show annotations) (download) (as text)
Sat Oct 7 06:26:34 2006 UTC (14 years ago) by johnpye
File MIME type: text/x-c++src
File size: 554 byte(s)
Can now access the ASCEND model from an external python script method. The API is not at all nice, but it's basically working now.
1 #include "registry.h"
2
3 extern "C"{
4 #include <compiler/importhandler.h>
5 }
6
7 void
8 Registry::setInteger(const char *key, int val){
9 importhandler_setsharedpointer(key,(void *)val);
10 }
11
12 void
13 Registry::setPointer(const char *key, void *val){
14 importhandler_setsharedpointer(key,val);
15 }
16
17 Instanc *
18 Registry::getInstance(const char *key){
19 return new Instanc((struct Instance*)importhandler_getsharedpointer(key));
20 }
21
22 #ifdef ASCXX_USE_PYTHON
23
24 void
25 Registry::setPyObject(const char *key, PyObject *val){
26 importhandler_setsharedpointer(key,(void *)val);
27 }
28
29 #endif

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