source: project/release/4/nemo/trunk/templates/NEST-function.tmpl @ 31508

Last change on this file since 31508 was 31508, checked in by Ivan Raikov, 5 years ago

nemo: continuation of nest backend refactoring

File size: 946 bytes
Line 
1
2{#
3   NEST function template
4
5   Template variables are:
6
7   - name: string with the name of the function
8   - vars: list of strings with the name of the arguments
9   - localVars: list of strings with the name of any local variables
10   - returnVar: the name of the return variable
11   - exprString: string with expression body converted to NMODL syntax
12   
13#}
14
15{{functionDef.returnType}} {{functionDef.name}} {{ functionDef.vars | join (", ") }} {
16
17  double {{functionDef.returnVar}};
18
19{% if (!(functionDef.localVars == [])) %}
20  double {{functionDef.localVars | join(", ")}};
21{% endif %}
22
23{% if (!(functionDef.consts == [])) %}
24  double {{functionDef.consts | join(", ")}};
25  const ~A::Parameters_{{modelName}} & p = *(reinterpret_cast< const {{modelName}}::Parameters_ *>(params));
26
27{% for const in functionDef.consts %}
28  {{const}} =  p.{{const}};
29{% endfor %}
30{% endif %}
31
32  {{functionDef.exprString}}
33
34  return {{functionDef.returnVar}};
35}
Note: See TracBrowser for help on using the repository browser.