Salome HOME
Split loadTemplate into 2 parts to ease overload of default visitor
[tools/adao_interface.git] / AdaoExchangeLayer.cxx
index 8e9e28087c4fb37e828299c6f88f8b8d5812c151..38b1ba3ff02fe8d75a6d70dc46caf8947470e281 100644 (file)
@@ -319,7 +319,7 @@ private:
   PyObject *_context = nullptr;
 };
 
-void AdaoExchangeLayer::loadTemplate(AdaoModel::MainModel *model)
+void AdaoExchangeLayer::setFunctionCallbackInModel(AdaoModel::MainModel *model)
 {
   AutoGIL agil;
   const char DECORATOR_FUNC[]="def DecoratorAdao(cppFunc):\n"
@@ -346,7 +346,11 @@ void AdaoExchangeLayer::loadTemplate(AdaoModel::MainModel *model)
   //
   Visitor1 visitor(this->_internal->_decorator_func,this->_internal->_context);
   model->visitPythonLeaves(&visitor);
-  //
+}
+
+void AdaoExchangeLayer::loadTemplate(AdaoModel::MainModel *model)
+{
+  AutoGIL agil;
   {
     std::string sciptPyOfModelMaker(model->pyStr());
     PyObjectRAII res(PyObjectRAII::FromNew(PyRun_String(sciptPyOfModelMaker.c_str(),Py_file_input,this->_internal->_context,this->_internal->_context)));