Code interface packaging (component) - Package generated code interface as reusable or nonreusable functions or as a

        C++ class - MATLAB ([original](http://www.mathworks.com/help/rtw/ref/codeinterfacepackaging.html)) ([raw](?raw))

Main Content

Package generated code interface as reusable or nonreusable functions or as a C++ class

Model Configuration Pane: Code Generation / Interface

Description

The Code interface packaging (component) parameter specifies how the code generator packages generated C or C++ interface code.

Settings

Nonreusable function (default) | Reusable function | C++ class

Nonreusable function

Generates nonreusable code. The code generator allocates model data structures statically. Generated entry-point functions access the data structures directly.

This is the default setting when Language is set to C.

Reusable function

Generates reusable, multi-instance code that is reentrant.

Selecting Reusable function:

If the System target file parameter is set to an ERT-based system target file:

C++ class

Generates a C++ class interface for the model. The generated interface encapsulates required model data into C++ class attributes and model entry point functions into C++ class methods.

To enable this value, set the Language parameter to C++. WhenLanguage is set toC++, this value is the default setting.

For a model configured with a service code interface, this parameter setting is not relevant and thus is not supported.

Selecting C++ class enables theMulti-instance code error diagnostic parameter.

You cannot select C++ class if you use a subsystem with the block parameterFunction packaging configured asNonreusable function and the parameter**Function with separate data** enabled.

Tips

Application Setting
Debugging No impact
Traceability No impact
Efficiency Reusable function or C++ class
Safety precaution No impact

Programmatic Use

Parameter: CodeInterfacePackaging
Type: character vector
Value: 'C++ class' | 'Nonreusable function' 'Reusable function'
Default: 'Nonreusable function' if TargetLang is set to'C'; 'C++ class' ifTargetLang is set to 'C++'

Version History

Introduced in R2014a

See Also

Code interface packaging (subcomponent) | model_step

Topics