文档

代码接口包装

描述

选择生成的C或C ++代码接口的包装。

类别:代码生成>接口

设置

默认:不可修复的功能如果参数is set toC;C ++类如果is set toC ++

C ++类

生成一个C ++类接口到模型代码。生成的界面将所需的模型数据封装到C ++类属性中,并将模型入口点功能纳入C ++类方法中。

不可修复的功能

生成不可避免的代码。模型数据结构是直接在模型代码中的模型入口点功能静态分配和访问的。

可重复使用的功能

生成可重用,米ulti-instance code that is reentrant, as follows:

  • 对于基于GRT的模型,生成的模型。csource file contains an allocation function that dynamically allocates model data for each instance of the model. For an ERT-based model, you can use parameter使用动态内存分配进行模型初始化控制是否生成分配函数。

  • 生成的代码通过参考将实时模型数据结构传递给模型_步以及其他模型入口点功能。

  • 实时模型数据结构用模型。h标题文件。

For an ERT-based model, you can use parameter通过根级I/O AS至control how root-level input and output arguments are passed to the reusable model entry-point functions. They can be included in the real-time model data structure that is passed to the functions, passed as individual arguments, or passed as references to an input structure and an output structure.

提示

  • 入口点已导出模型。h。To call the entry-point functions from handwritten code, add an#include model.hdirective to the code.

  • When you select可重复使用的功能,代码生成器生成一个指向实时模型对象的指针(模型_M)。

  • When you select可重复使用的功能,代码生成器可以生成编译但不是重新进入的代码。例如,如果信号,dwork结构或参数数据具有以外的存储类Auto,生成全球数据结构。

依赖性

  • 价值C ++类仅在参数时可用is set toC ++

  • 选择可重复使用的功能orC ++类启用参数Multi-instance code error diagnostic

  • 对于基于ERT的系统目标文件,选择可重复使用的功能启用参数通过根级I/O ASand使用动态内存分配进行模型初始化

  • 启用参数经典呼叫接口, 选择不可修复的功能

  • 对于基于ERT的系统目标文件,选择C ++类enables the following model configuration controls for customizing the model class interface:

    • 配置C ++类接口按钮

    • 数据成员可见性/访问控制子板

    • 参数产生驱动器and使用动态内存分配进行模型块实例化

  • 对于基于ERT的系统目标文件,您可以选择可重复使用的功能与静态ERT_MAIN.C模块,如果您执行以下操作:

    • 设置参数通过根级I/O AS模型数据结构的一部分

    • Select parameter使用动态内存分配进行模型初始化

  • 对于基于ERT的系统目标文件,您无法选择可重复使用的功能如果你是:

    • 自定义model_step功能原型

    • 选择子系统块参数Function with separate data

    • 使用一个子系统

      • 有多个共享来源的端口

      • 具有子系统多个实例使用的端口,并具有不同的样本时间,数据类型,复杂性,帧状态或尺寸

      • Has output marked as a global signal

      • 对于每个实例,都包含具有不同名称或参数设置的相同块

  • 选择可重复使用的功能does not change the code generated for function-call subsystems.

Command-Line Information

Parameter:CodeInterfacePackaging
类型:角色向量
价值:'C ++类'|'Nonreusable function'|'Reusable function'
默认:'Nonreusable function'如果TargetLangis set to'C';'C ++类'如果TargetLangis set to'C ++'

推荐设置

应用 Setting
调试 No impact
可追溯性 No impact
效率 可重复使用的功能orC ++类
安全预防措施 No impact

也可以看看

Related Topics