#include "PyObjectRAII.hxx"
#include "Python.h"
-#include "py2cpp/py2cpp.hxx"
-
#include <semaphore.h>
-
#include <iostream>
#include <sstream>
#include <clocale>
AdaoExchangeLayer::~AdaoExchangeLayer()
{
+ AutoGIL agil;
delete _internal;
}
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"
//
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)));