Parent Directory
|
Revision Log
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 |