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

Annotation of /trunk/pygtk/registry.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 875 - (hide annotations) (download) (as text)
Sat Oct 7 06:26:34 2006 UTC (13 years, 11 months 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 johnpye 869 #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 johnpye 875 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 johnpye 869 #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