| Contents | Index |
setNameSpace(hEntry, nameSpace)
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
String specifying the name space in which the implementation function for the C++ function entry is defined.
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.
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');
enableCPP | registerCPPFunctionEntry

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 |