Main Content

copyConceptualArgsToImplementation

Copy conceptual argument specifications to implementation specifications of an entry for code replacement table entry

Description

example

copyConceptualArgsToImplementation(hEntry) provides a quick way to perform a shallow copy of conceptual arguments to matching implementation arguments.

The conceptual arguments and implementation arguments refer to the same argument instance. If you update an implementation argument, the corresponding conceptual argument is also updated.

Use this function when the conceptual arguments and the implementation arguments are the same for a code replacement table entry.

For arguments with an unsized type, such as integer, the code generator determines the size of the argument values based on hardware implementation configuration settings of the MATLAB® code or model.

Examples

collapse all

This example shows how to use the copyConceptualArgsToImplementation function to copy conceptual argument specifications to matching implementation arguments for an addition operation.

hLib = RTW.TflTable;

% Create an entry for addition of built-in uint8 data type
op_entry = RTW.TflCOperationEntry;
op_entry.setTflCOperationEntryParameters( ...
    'Key',                      'RTW_OP_ADD', ...
    'Priority',                 90, ...
    'SaturationMode',           'RTW_SATURATE_ON_OVERFLOW', ...
    'RoundingModes',            {'RTW_ROUND_UNSPECIFIED'}, ...
    'ImplementationName',       'u8_add_u8_u8', ...
    'ImplementationHeaderFile', 'u8_add_u8_u8.h', ...
    'ImplementationSourceFile', 'u8_add_u8_u8.c' );

arg = hLib.getTflArgFromString('y1','uint8');
arg.IOType = 'RTW_IO_OUTPUT';
op_entry.addConceptualArg(arg);

arg = hLib.getTflArgFromString('u1','uint8');
op_entry.addConceptualArg(arg);

arg = hLib.getTflArgFromString('u2','uint8');
op_entry.addConceptualArg(arg);

op_entry.copyConceptualArgsToImplementation();

addEntry(hLib, op_entry);

Input Arguments

collapse all

The hEntry is a handle to a code replacement table entry previously returned by instantiating a code replacement table entry class, such as hEntry = RTW.TflCFunctionEntry or hEntry = RTW.TflCOperationEntry.

Example: op_entry

Version History

Introduced in R2007b