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, compiler_kwds, 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__(**kwds) Call self as a function.
run() Runs the code in the namespace.



Call self as a function.


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.