| 345 | } |
| 346 | |
| 347 | void SetBoolean(const fmi2ValueReference* vr, std::size_t nvr, const fmi2Boolean* values) override |
| 348 | { |
| 349 | py_safe_run([this, &vr, nvr, &values](PyGILState_STATE gilState) { |
| 350 | PyObject* vrs = PyList_New(nvr); |
| 351 | PyObject* refs = PyList_New(nvr); |
| 352 | for (int i = 0; i < nvr; i++) { |
| 353 | PyList_SetItem(vrs, i, Py_BuildValue("i", vr[i])); |
| 354 | PyList_SetItem(refs, i, PyBool_FromLong(values[i])); |
| 355 | } |
| 356 | |
| 357 | auto f = PyObject_CallMethod(pInstance_, "set_boolean", "(OO)", vrs, refs); |
| 358 | Py_DECREF(vrs); |
| 359 | Py_DECREF(refs); |
| 360 | if (f == nullptr) { |
| 361 | handle_py_exception("[setBoolean] PyObject_CallMethod", gilState); |
| 362 | } |
| 363 | Py_DECREF(f); |
| 364 | clearLogBuffer(); |
| 365 | }); |
| 366 | } |
| 367 | |
| 368 | void SetString(const fmi2ValueReference* vr, std::size_t nvr, fmi2String const* values) override |
| 369 | { |
no test coverage detected