{# NEST function template Template variables are: - name: string with the name of the function - vars: list of strings with the name of the arguments - localVars: list of strings with the name of any local variables - returnVar: the name of the return variable - exprString: string with expression body converted to NMODL syntax #} {% macro nest_function(name,returnType,returnVar,vars,localVars,consts,exprString) %} {{returnType}} {{name}} ({{ vars | join (", ") }}) { double {{returnVar}}; {% if (not (localVars == [])) %} double {{localVars | join(", ")}}; {% endif %} {% if (not (consts == [])) %} double {{consts | join(", ")}}; const {{modelName}}::Parameters_ & p = *(reinterpret_cast< const {{modelName}}::Parameters_ *>(params)); {% for const in consts %} {{const}} = p.{{const}}; {% endfor %} {% endif %} {{exprString}} return {{returnVar}}; } {% endmacro %}