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. 2
      modules/matlab/generator/templates/functional.cpp
  2. 10
      modules/matlab/generator/templates/template_function_base.cpp

@ -67,4 +67,4 @@
outputs[{{loop.index0 + fun.rtp|void|not + fun.req|outputs|length}}] = {{opt.name}}; outputs[{{loop.index0 + fun.rtp|void|not + fun.req|outputs|length}}] = {{opt.name}};
{% endfor %} {% endfor %}
{%- endmacro -%} {% endmacro %}

@ -36,9 +36,15 @@ void mexFunction(int nlhs, mxArray* plhs[],
// setup // setup
std::vector<Bridge> inputs(plhs, plhs+nrhs); 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) }} {{ 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