C++ Data and Function Interfaces - MATLAB & Simulink (original) (raw)
Main Content
Control the C++ class generated from a Simulink model
To generate efficient C++ code that easily plugs into your existing software architecture, configure a C++ class interface. When you generate a C++ class interface from a model, the model appears as a class, data elements appear as class members, and model functions appear as class methods. Configuring a C++ class interface, interactively or programmatically, allows you to configure:
- Class information — Class name and namespace
- Class member information — Class member data visibility and access method
- Class method information — Class method names and arguments
You can use these customizations to quickly adjust the generated interface from rate-based and export-function models to meet your application integration requirements.
Tools
Objects
Functions
coder.mapping.api.get | Get code mappings for model (Since R2020b) |
---|---|
coder.mapping.utils.create | Create code mappings object for configuring data and function interface for C and C++ code generation (Since R2020b) |
find | Get model elements for the category of model code mappings (Since R2021a) |
getClassName | Get class name of model (Since R2021a) |
---|---|
setClassName | Set class name of model (Since R2021a) |
getClassNamespace | Get class namespace for a model (Since R2021a) |
setClassNamespace | Set class namespace of model (Since R2021a) |
getData | Get code mapping configuration for model data (Since R2021a) |
setData | Configure model data for C++ code generation (Since R2021a) |
getFunction | Get code configuration from code mappings for model function (Since R2021a) |
setFunction | Set code mapping information for model function (Since R2021a) |
Topics
- C Data Code Interface Configuration for Model Interface Elements
Control the representation of model data elements and functions in generated C code by using a data code interface configuration. - Interactively Configure C++ Interface
Interactively configure the C++ class generated from a Simulink® model. - Programmatically Configure C++ Interface
Programmatically configure the C++ class generated from a Simulink model. - Configure Parameters for C++ Interface Code Generation
Configure and generate code for instance-specific or shared parameters. - Manage Multiple Code Mappings for a Model
Design models that are platform-neutral and ready to deploy to different run-time environments. - Generate Individual C++ Namespaces for Architectural Data Types
Example of generating C++ namespaces for architectural data types.