coder.descriptor.FunctionInterface - Return information about entry-point functions - MATLAB (original) (raw)

Main Content

Namespace: coder.descriptor

Return information about entry-point functions

Description

The function interfaces are the entry-point functions in the generated code. Thecoder.descriptor.FunctionInterface object describes various properties for a specified function interface. The different types of function interfaces are:

Creation

`functionInterface` = getFunctionInterfaces(`codeDescObj`, [functionInterfaceName](#mw%5F23f6f19a-040f-4d48-a371-754208bc57d9)) creates a coder.descriptor.FunctionInterface object.codeDescObj is the coder.codedescriptor.CodeDescriptor object created for the model by using the getCodeDescriptor function.

Input Arguments

expand all

Name of the specified function interface.

Example: 'Output'

Data Types: string

Properties

expand all

Description of the function prototype, including the function return value, name, arguments, header, and source file, specified as a coder.descriptor.Prototype object.

Attributes:

GetAccess public
SetAccess public

Return arguments from the function, specified as acoder.descriptor.DataInterface object. When the function returns no data, this field is empty.

Attributes:

GetAccess public
SetAccess public

Variant conditions in the model that interact with the function interface, specified as a coder.descriptor.VariantInfo object.

Attributes:

GetAccess public
SetAccess public

Function owner of the class that the function belongs to, specified as acoder.descriptor.TypedRegion object. For C code generation, this property is empty.

Attributes:

GetAccess public
SetAccess public

Function access rate in the target environment, specified as acoder.descriptor.TimingInterface object.

Attributes:

GetAccess public
SetAccess public

Input arguments to the function, specified as acoder.descriptor.DataInterfaceList object. When there is no data passed as an argument to the function, this property is empty.

Attributes:

Examples

collapse all

  1. Open the model.
    openExample(‘CustomCodeComments’)
  2. Build the model.
    slbuild('CustomCodeComments')
  3. Create a coder.codedescriptor.CodeDescriptor object for the required model.
    codeDescObj = coder.getCodeDescriptor('rtwdemo_comments')
  4. Return a list of all function interface types in the generated code.
    functionInterfaceTypes = getFunctionInterfaceTypes(codeDescObj)
    {'Initialize'}
    {'Output' }
  5. Return properties of a specified function interface in the generated code.
    functionInterface = getFunctionInterfaces(codeDescObj,'Output')
    Prototype: [1×1 coder.descriptor.types.Prototype]
    ActualReturn: [0×0 coder.descriptor.DataInterface]
    VariantInfo: [0×0 coder.descriptor.VariantInfo]
    Timing: [1×1 coder.descriptor.TimingInterface]
    ActualArgs: [1x0 coder.descriptor.DataInterface List]

Version History

Introduced in R2018a