CPPStandaloneCodeObject class

(Shortest import: from brian2.devices.cpp_standalone import CPPStandaloneCodeObject)

class brian2.devices.cpp_standalone.codeobject.CPPStandaloneCodeObject(owner, code, variables, variable_indices, template_name, template_source, name='codeobject*')[source]

Bases: brian2.codegen.codeobject.CodeObject

C++ standalone code object

The code should be a MultiTemplate object with two macros defined, main (for the main loop code) and support_code for any support code (e.g. function definitions).


__call__(…) <==> x(…)
run() Runs the code in the namespace.


__call__(...) <==> x(...)[source]

Runs the code in the namespace.


return_value : dict

A dictionary with the keys corresponding to the output_variables defined during the call of CodeGenerator.code_object.