主要内容

C++ 数据接口和函数接口

控制从 Simulink 模型生成的 C++ 类

要生成可轻松插入您现有软件架构中的高效 C++ 代码,请配置 C++ 类接口。从模型生成 C++ 类接口时,模型显示为类,数据元素显示为类成员,模型函数显示为类方法。通过以交互方式或编程方式配置 C++ 类接口,您可以配置:

  • 类信息 - 类名称和命名空间

  • 类成员信息 - 类成员数据可见性和访问方法

  • 类方法信息 - 类方法名称和参量

您可以使用这些自定义快速调整基于速率和导出函数模型生成的接口,以满足您的应用程序集成要求。

工具

代码映射 - C++ 编辑器Configure how model elements and functions appear in generated C++ code (自 R2021a 起)

对象

coder.mapping.api.CodeMappingCPPC++ 代码生成的模型数据和接口配置 (自 R2021a 起)

函数

全部展开

coder.mapping.api.getGet code mappings for model
coder.mapping.utils.create创建代码映射对象,用于配置 C 和 C++ 代码生成的数据和函数接口
findGet model elements for the category of model code mappings (自 R2021a 起)
getClassName获取模型的类名 (自 R2021a 起)
setClassNameSet class name of model (自 R2021a 起)
getClassNamespaceGet class namespace for a model (自 R2021a 起)
setClassNamespaceSet class namespace of model (自 R2021a 起)
getDataGet code mapping configuration for model data (自 R2021a 起)
setDataConfigure model data for C++ code generation (自 R2021a 起)
getFunctionGet code configuration from code mappings for model function (自 R2021a 起)
setFunctionSet code mapping information for model function (自 R2021a 起)

主题

精选示例