.. _ref_generated_code: Generated code ============== This section contains the classes related to Scade One Generated Code. It relies on the JSON mapping file generated by Scade One CG via a code generation job defined in a Scade One project. .. code:: python from ansys.scadeone.core import ScadeOne from ansys.scadeone.core.svc.generated_code import GeneratedCode with ScadeOne() as app: project = app.load_project('project.sproj') code_gen = GeneratedCode(project, "CodeGen") .. currentmodule:: ansys.scadeone.core.svc.generated_code From the :py:class:`GeneratedCode` object, methods are provided to navigate in the model as it is defined in the mapping file in order to get the corresponding generated code artifacts. The next sections describe: - the :ref:`main class` for generated code :py:class:`GeneratedCode`, - the :ref:`classes` related to model elements, - the :ref:`classes` related to generated code. .. _ref_gc_main_class: Main class ---------- This section describes the main class for generated code. .. autoclass:: GeneratedCode .. _ref_gc_model_classes: Model classes ------------- Model classes are used to represent the model elements: - :py:class:`ModelOperator` represents a model operator - :py:class:`ModelMonomorphicInstance` represents a monomorphic instance (after generic type resolution) - :py:class:`ModelVariable` represents a model variable (input or output) - :py:class:`ModelVariableMonomorphic` represents a monomorphic variable (after generic type resolution) - :py:class:`ModelSensor` represents a model sensor .. autoclass:: ModelOperator :members: :inherited-members: .. autoclass:: ModelMonomorphicInstance :members: :inherited-members: .. autoclass:: ModelVariable :members: :inherited-members: .. autoclass:: ModelVariableMonomorphic :members: :inherited-members: .. autoclass:: ModelSensor :members: :inherited-members: .. _ref_gc_code_classes: Code classes ------------ Generated code classes are used to represent the generated code elements: - :py:class:`CFunction` represents a C function - :py:class:`CParameter` represents a C parameter .. autoclass:: CFunction :members: :inherited-members: .. autoclass:: CParameter :members: :inherited-members: Base classes ------------ .. autoclass:: ModelOperatorBase :members: :inherited-members: .. autoclass:: ModelVariableBase :members: :inherited-members: .. autoclass:: ModelObject :members: :inherited-members: .. autoclass:: CDeclaration :members: :inherited-members: .. autoclass:: MappingObject :members: :inherited-members: