Function templates now include the full skeleton, from input to output. Class templates need work
This commit is contained in:
parent
f45bc35652
commit
0263727b53
@ -66,5 +66,5 @@
|
||||
{% for opt in fun.opt|outputs %}
|
||||
outputs[{{loop.index0 + fun.rtp|void|not + fun.req|outputs|length}}] = {{opt.name}};
|
||||
{% endfor %}
|
||||
|
||||
{%- endmacro -%}
|
||||
|
||||
{% endmacro %}
|
||||
|
@ -36,9 +36,15 @@ void mexFunction(int nlhs, mxArray* plhs[],
|
||||
|
||||
// setup
|
||||
std::vector<Bridge> inputs(plhs, plhs+nrhs);
|
||||
std::vector<Bridge> outputs(nlhs);
|
||||
{% set noutputs = fun.rtp|void|not + fun.req|outputs|length + fun.opt|outputs|length %}
|
||||
{%- if noutputs %}
|
||||
std::vector<Bridge> outputs({{noutputs}});
|
||||
{% endif %}
|
||||
|
||||
{{ functional.generate(fun) }}
|
||||
|
||||
// setdown
|
||||
// push the outputs back to matlab
|
||||
for (size_t n = 0; n < nlhs; ++n) {
|
||||
plhs[n] = outputs[n].mxArray();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user