Function templates now include the full skeleton, from input to output. Class templates need work

pull/1384/head
hbristow 12 years ago
parent f45bc35652
commit 0263727b53
  1. 4
      modules/matlab/generator/templates/functional.cpp
  2. 10
      modules/matlab/generator/templates/template_function_base.cpp

@ -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…
Cancel
Save