MCPcopy Create free account
hub / github.com/astra-toolbox/astra-toolbox / initialize

Method initialize

python/astra/src/PythonPluginAlgorithm.cpp:98–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98bool 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
116bool CPluginAlgorithm::run(int _iNrIterations){
117 if(instance==NULL) return false;

Callers

nothing calls this directly

Calls 2

XMLNode2dictFunction · 0.85
logPythonErrorFunction · 0.85

Tested by

no test coverage detected