| 96 | } |
| 97 | |
| 98 | bool CPluginAlgorithm::initialize(const Config& _cfg){ |
| 99 | if(instance==NULL) return false; |
| 100 | |
| 101 | const XMLConfig *xmlcfg = dynamic_cast<const XMLConfig*>(&_cfg); |
| 102 | if (xmlcfg==NULL) return false; |
| 103 | |
| 104 | PyObject *cfgDict = XMLNode2dict(xmlcfg->self); |
| 105 | PyObject *retVal = PyObject_CallMethod(instance, "astra_init", "O",cfgDict); |
| 106 | Py_DECREF(cfgDict); |
| 107 | if(retVal==NULL){ |
| 108 | logPythonError(); |
| 109 | return false; |
| 110 | } |
| 111 | m_bIsInitialized = true; |
| 112 | Py_DECREF(retVal); |
| 113 | return m_bIsInitialized; |
| 114 | } |
| 115 | |
| 116 | bool CPluginAlgorithm::run(int _iNrIterations){ |
| 117 | if(instance==NULL) return false; |
nothing calls this directly
no test coverage detected