Main Content

enableCPP

Enable C++ support for function entry in code replacement table

Description

example

enableCPP(hEntry) enables C++ support for a function entry in a code replacement table. This support allows you to specify a C++ namespace for the implementation function defined in the entry (see the setNameSpace function).

When you register a code replacement library containing C++ function entries, you must specify the value {'C++'} for the LanguageConstraint property of the code replacement registry entry. For more information, see Register Code Replacement Library.

Examples

collapse all

This example shows how to use the enableCPP function to enable C++ support. Then, the example calls the setNameSpace function to set the namespace for the sin implementation function to std.

fcn_entry = RTW.TflCFunctionEntry;
fcn_entry.setTflCFunctionEntryParameters( ...
    'Key',                      'sin', ...
    'Priority',                 100, ...
    'ImplementationName',       'sin', ...
    'ImplementationHeaderFile', 'cmath' );
fcn_entry.enableCPP();
fcn_entry.setNameSpace('std');

Input Arguments

collapse all

The hEntry is a handle to a code replacement function entry previously returned by hEntry = RTW.TflCFunctionEntry or hEntry = MyCustomFunctionEntry. The MyCustomFunctionEntry is a class derived from RTW.TflCFunctionEntry.

Example: fcn_entry

Version History

Introduced in R2010a