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:
- Allocation: Contains memory allocation code based on the target of the model. Seemodel_initialize.
- Initialize: Contains initialization code for the model and is called once at the start of your application code. See model_initialize.
- Output: Contains the output code for the blocks in the model. See model_step.
- Update: Contains the update code for the blocks in the model. See model_step.
- Terminate: Contains the termination code for the model and is called as part of a system shutdown. See model_terminate.
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
Name of the specified function interface.
Example: 'Output'
Data Types: string
Properties
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
- Open the model.
openExample(‘CustomCodeComments’) - Build the model.
slbuild('CustomCodeComments') - Create a
coder.codedescriptor.CodeDescriptor
object for the required model.
codeDescObj = coder.getCodeDescriptor('rtwdemo_comments') - Return a list of all function interface types in the generated code.
functionInterfaceTypes = getFunctionInterfaceTypes(codeDescObj)
{'Initialize'}
{'Output' } - 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