coder.mapping.api.CodeMappingCPP
Description
A code mappings object and related functions enable you to configure C++ code generation for data and functions of a Simulink model. For model data elements, code mappings associate data elements with configurations that consist of a storage class and storage class properties. For functions, code mappings associate entry-point functions with configurations that consist of a function customization template. Reduce the effort of preparing a model for C++ code generation by specifying default configurations for categories of data elements and functions across a model. Override default configurations by configuring data elements or functions individually. For smaller models, you can choose to configure each data element and function individually.
Creation
When you select the Embedded Coder app from the Apps tab in the
Simulink® Editor, the app creates a coder.mapping.api.CodeMappingCPP
object if code mappings do not already exist. The app creates code mappings based on code
customization settings stored in the model active configuration set object. The configuration
set object can specify memory sections for data and functions.
Access a coder.mapping.api.CodeMappingCPP
object programmatically by
using the coder.mapping.utils.create
or coder.mapping.api.get
functions.
Object Functions
find | Get model elements for the category of model code mappings |
getClassName | Get class name of model |
setClassName | Set class name of model |
getClassNamespace | Get class namespace for a model |
setClassNamespace | Set class namespace of model |
getData | Get code mapping configuration for model data |
setData | Configure model data for C++ code generation |
getFunction | Get code configuration from code mappings for model function |
setFunction | Set code mapping information for model function |
Examples
Version History
Introduced in R2021a