Main Content

destroy

Destroy data interface and remove from interface dictionary

Since R2022b

    In R2023b the Architectural Data section of data dictionaries was introduced. When managing interfaces, data types, constants, and software address methods consider using the Simulink.dictionary.ArchitecturalData programmatic interfaces instead. For more information, see Programmatically Manage AUTOSAR Architectural Data.

    Description

    destroy(dataInterfaceObj) destroys the data interface dataInterfaceObj and removes it from its parent interface dictionary.

    example

    Examples

    collapse all

    This example shows how to delete a data interface and remove it from an interface dictionary.

    Create a Simulink.interface.Dictionary object by opening an existing interface dictionary.

    interfaceDictObj = Simulink.interface.dictionary.open('myInterfaceDict.sldd')
    interfaceDictObj = 
      Dictionary with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [1×1 Simulink.interface.dictionary.DataInterface]
                 DataTypes: [0×0 Simulink.interface.dictionary.DataType]

    This interface dictionary has one data interface definition.

    interfaceObj = interfaceDictObj.Interfaces
    interfaceObj = 
      DataInterface with properties:
    
               Name: 'interface1'
        Description: ''
           Elements: [1×2 Simulink.interface.dictionary.DataElement]
              Owner: [1×1 Simulink.interface.Dictionary]
    
    

    Use the destroy function to delete the interface and remove it from the interface dictionary.

    destroy(interfaceObj)
    interfaceDictObj
    
    interfaceDictObj = 
    
      Dictionary with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [0×0 Simulink.interface.dictionary.DataInterface]
                 DataTypes: [0×0 Simulink.interface.dictionary.DataType]

    The interface dictionary interfaceDictObj now has no interfaces.

    Input Arguments

    collapse all

    Data interface to delete, specified as a Simulink.interface.dictionary.DataInterface object.

    Version History

    Introduced in R2022b

    collapse all