@@ -26,6 +26,40 @@ EMSCRIPTEN_BINDINGS(libcellml_interpreter)
26
26
.smart_ptr_constructor (" Interpreter" , &libcellml::Interpreter::create)
27
27
.function (" model" , &libcellml::Interpreter::model)
28
28
.function (" setModel" , &libcellml::Interpreter::setModel)
29
+ .function (" voi" , &libcellml::Interpreter::voi)
30
+ .function (" stateCount" , &libcellml::Interpreter::stateCount)
31
+ .function (" states" , emscripten::optional_override ([](libcellml::InterpreterPtr &interpreter) {
32
+ auto states = interpreter->states ();
33
+ auto stateCount = interpreter->stateCount ();
34
+ auto view = emscripten::typed_memory_view (stateCount, states);
35
+ auto res = emscripten::val::global (" Uint8Array" ).new_ (stateCount);
36
+
37
+ res.call <void >(" set" , view);
38
+
39
+ return res;
40
+ }))
41
+ .function (" rateCount" , &libcellml::Interpreter::rateCount)
42
+ .function (" rates" , emscripten::optional_override ([](libcellml::InterpreterPtr &interpreter) {
43
+ auto rates = interpreter->rates ();
44
+ auto rateCount = interpreter->rateCount ();
45
+ auto view = emscripten::typed_memory_view (rateCount, rates);
46
+ auto res = emscripten::val::global (" Uint8Array" ).new_ (rateCount);
47
+
48
+ res.call <void >(" set" , view);
49
+
50
+ return res;
51
+ }))
52
+ .function (" variableCount" , &libcellml::Interpreter::variableCount)
53
+ .function (" variables" , emscripten::optional_override ([](libcellml::InterpreterPtr &interpreter) {
54
+ auto variables = interpreter->variables ();
55
+ auto variableCount = interpreter->variableCount ();
56
+ auto view = emscripten::typed_memory_view (variableCount, variables);
57
+ auto res = emscripten::val::global (" Uint8Array" ).new_ (variableCount);
58
+
59
+ res.call <void >(" set" , view);
60
+
61
+ return res;
62
+ }))
29
63
.function (" initialiseVariables" , &libcellml::Interpreter::initialiseVariables)
30
64
.function (" computeComputedConstants" , &libcellml::Interpreter::computeComputedConstants)
31
65
.function (" computeRates" , &libcellml::Interpreter::computeRates)
0 commit comments