Skip to Main Content Skip to Search
Product Documentation

setNameSpace - Set name space for C++ function entry in CRL table

Syntax

setNameSpace(hEntry, nameSpace)

Arguments

hEntry

Handle to a CRL function entry previously returned by one of the following:

  • hEntry = RTW.TflCFunctionEntry

  • hEntry = MyCustomFunctionEntry, where MyCustomFunctionEntry is a class derived from RTW.TflCFunctionEntry

  • A call to the registerCPPFunctionEntry function

nameSpace

String specifying the name space in which the implementation function for the C++ function entry is defined.

Description

The setNameSpace function specifies the name space for a C++ function entry in a CRL table. During code generation, if the CRL function entry is matched, the software emits the name space in the generated function code (for example, std::sin(tfl_cpp_U.In1)).

If you created the function entry using hEntry = RTW.TflCFunctionEntry or hEntry = MyCustomFunctionEntry (that is, not using registerCPPFunctionEntry), then, before calling the setNameSpace function, you must enable C++ support for the function entry by calling the enableCPP function.

Examples

In the following example, the setNameSpace function is used to set the name space 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');

See Also

enableCPP | registerCPPFunctionEntry

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS