|
| 1 | +.. _ar4_datatype_DataTypeMappingSet: |
| 2 | + |
| 3 | +DataTypeMappingSet |
| 4 | +================== |
| 5 | + |
| 6 | +.. table:: |
| 7 | + :align: left |
| 8 | + |
| 9 | + +--------------------+------------------------------------------------------+ |
| 10 | + | XML tag | <DATA-TYPE-MAPPING-SET> | |
| 11 | + +--------------------+------------------------------------------------------+ |
| 12 | + | Module | autosar.datatype | |
| 13 | + +--------------------+------------------------------------------------------+ |
| 14 | + | Inherits | :ref:`autosar.element.Element <ar4_element_Element>` | |
| 15 | + +--------------------+------------------------------------------------------+ |
| 16 | + |
| 17 | +This class contains type mappings between ApplicationDataTypes and ImplementationDataTypes. |
| 18 | +In addition, it can contain type mappings between ModeDeclarationGroups and ImplementationDataTypes. |
| 19 | + |
| 20 | +Factory Methods |
| 21 | +--------------- |
| 22 | + |
| 23 | +* :ref:`Package.createDataTypeMappingSet <ar4_package_Package_createDataTypeMappingSet>` |
| 24 | + |
| 25 | + |
| 26 | +Attributes |
| 27 | +---------- |
| 28 | + |
| 29 | +For inherited attributes see :ref:`autosar.element.Element <ar4_element_Element>`. |
| 30 | + |
| 31 | +.. table:: |
| 32 | + :align: left |
| 33 | + |
| 34 | + +--------------------------+-------------------+-----------------------------------------------------+ |
| 35 | + | Name | Type | Description | |
| 36 | + +==========================+===================+=====================================================+ |
| 37 | + | **applicationTypeMap** | dict | Application data type mappings | |
| 38 | + +--------------------------+-------------------+-----------------------------------------------------+ |
| 39 | + | **modeRequestMap** | dict | Mode request mappings | |
| 40 | + +--------------------------+-------------------+-----------------------------------------------------+ |
| 41 | + |
| 42 | +The ARXML definition uses lists containing mappings while Python uses dictionaries. |
| 43 | +For the **applicationTypeMap** dictionary, each key is a reference to an application data type and each value |
| 44 | +is a reference to an implementation data type. |
| 45 | +Likewise for the *modeRequestMap* dictionary, each key is a reference to a mode declaration group and each value |
| 46 | +is a reference to an implementation data type. |
| 47 | + |
| 48 | +Public Methods |
| 49 | +-------------- |
| 50 | + |
| 51 | +* :ref:`ar4_datatype_DataTypeMappingSet_createDataTypeMapping` |
| 52 | +* :ref:`ar4_datatype_DataTypeMappingSet_createModeRequestMapping` |
| 53 | +* :ref:`ar4_datatype_DataTypeMappingSet_add` |
| 54 | +* :ref:`ar4_datatype_DataTypeMappingSet_getDataTypeMapping` |
| 55 | +* :ref:`ar4_datatype_DataTypeMappingSet_getModeRequestMapping` |
| 56 | +* :ref:`ar4_datatype_DataTypeMappingSet_findMappedDataTypeRef` |
| 57 | +* :ref:`ar4_datatype_DataTypeMappingSet_findMappedModeRequestRef` |
| 58 | +* :ref:`ar4_datatype_DataTypeMappingSet_findMappedDataType` |
| 59 | +* :ref:`ar4_datatype_DataTypeMappingSet_findMappedModeRequest` |
| 60 | + |
| 61 | +Method Description |
| 62 | +-------------------- |
| 63 | + |
| 64 | +.. _ar4_datatype_DataTypeMappingSet_createDataTypeMapping: |
| 65 | + |
| 66 | +createDataTypeMapping |
| 67 | +~~~~~~~~~~~~~~~~~~~~~ |
| 68 | + |
| 69 | +.. method:: DataTypeMappingSet.createDataTypeMapping(applicationDataTypeRef : str, implementationDataTypeRef : str) |
| 70 | + |
| 71 | + Creates a new type mapping between an application type (reference) and implementation data type (reference). |
| 72 | + The created mapping is added to the internal applicationTypeMap dictionary. |
| 73 | + |
| 74 | + :param str applicationDataTypeRef: Reference to an ApplicationDataType |
| 75 | + :param str implementationDataTypeRef: Reference to an :ref:`ar4_datatype_ImplementationDataType` |
| 76 | + |
| 77 | +.. _ar4_datatype_DataTypeMappingSet_createModeRequestMapping: |
| 78 | + |
| 79 | +createModeRequestMapping |
| 80 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 81 | + |
| 82 | +.. method:: DataTypeMappingSet.createModeRequestMapping(modeDeclarationGroupRef : str, implementationDataTypeRef : str) |
| 83 | + |
| 84 | + Creates a new type mapping between a mode declaration group (reference) and implementation data type (reference). |
| 85 | + The created mapping is added to the internal modeRequestMap dictionary. |
| 86 | + |
| 87 | + :param str modeDeclarationGroupRef: Reference to a :ref:`ar4_mode_ModeDeclarationGroup` |
| 88 | + :param str implementationDataTypeRef: Reference to an :ref:`ar4_datatype_ImplementationDataType` |
| 89 | + |
| 90 | +.. _ar4_datatype_DataTypeMappingSet_add: |
| 91 | + |
| 92 | +add |
| 93 | +~~~ |
| 94 | + |
| 95 | +.. method:: DataTypeMappingSet.add(item) |
| 96 | + |
| 97 | + Adds a user-created mapping to this mapping set. |
| 98 | + If the item is of type :ref:`ar4_datatype_DataTypeMap` it gets inserted into to the applicationTypeMap dictionary. |
| 99 | + Likewise, if the item is of type :ref:`ar4_datatype_ModeRequestTypeMap` it gets inserted into to the modeRequestMap dictionary. |
| 100 | + |
| 101 | + :param item: Reference to an ApplicationDataType |
| 102 | + :type item: :ref:`ar4_datatype_DataTypeMap` or :ref:`ar4_datatype_ModeRequestTypeMap` |
| 103 | + |
| 104 | +.. _ar4_datatype_DataTypeMappingSet_getDataTypeMapping: |
| 105 | + |
| 106 | +getDataTypeMapping |
| 107 | +~~~~~~~~~~~~~~~~~~ |
| 108 | + |
| 109 | +.. method:: DataTypeMappingSet.getDataTypeMapping(applicationDataTypeRef : str) |
| 110 | + |
| 111 | + Returns the mapping object that is currently associated with the given application data type reference. |
| 112 | + If the reference string is not found in the internal applicationTypeMap dictionary, None is returned. |
| 113 | + |
| 114 | + :param str applicationDataTypeRef: Reference to an :ref:`ar4_datatype_ApplicationDataType` |
| 115 | + :rtype: :ref:`ar4_datatype_DataTypeMappingSet` or None |
| 116 | + |
| 117 | +.. _ar4_datatype_DataTypeMappingSet_getModeRequestMapping: |
| 118 | + |
| 119 | +getModeRequestMapping |
| 120 | +~~~~~~~~~~~~~~~~~~~~~ |
| 121 | + |
| 122 | +.. method:: DataTypeMappingSet.getModeRequestMapping(modeDeclarationGroupRef : str) |
| 123 | + |
| 124 | + Returns the mapping object that is currently associated with the given mode declaration group reference. |
| 125 | + If the reference string is not found in the internal modeRequestMap dictionary, None is returned. |
| 126 | + |
| 127 | + :param str modeDeclarationGroupRef: Reference to a |
| 128 | + :rtype: :ref:`ar4_mode_ModeDeclarationGroup` or None |
| 129 | + |
| 130 | +.. _ar4_datatype_DataTypeMappingSet_findMappedDataTypeRef: |
| 131 | + |
| 132 | +findMappedDataTypeRef |
| 133 | +~~~~~~~~~~~~~~~~~~~~~ |
| 134 | + |
| 135 | +.. method:: DataTypeMappingSet.findMappedDataTypeRef(applicationDataTypeRef : str) |
| 136 | + |
| 137 | + Same as :ref:`ar4_datatype_DataTypeMappingSet_getDataTypeMapping` but instead returns the reference to the mapped implementation data type. |
| 138 | + Returns None in case the application data type reference is not part of the internal applicationTypeMap dictionary. |
| 139 | + |
| 140 | + :param str applicationDataTypeRef: Reference to an :ref:`ar4_datatype_ApplicationDataType` |
| 141 | + :rtype: str |
| 142 | + |
| 143 | +.. _ar4_datatype_DataTypeMappingSet_findMappedModeRequestRef: |
| 144 | + |
| 145 | +findMappedModeRequestRef |
| 146 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 147 | + |
| 148 | +.. method:: DataTypeMappingSet.findMappedModeRequestRef(modeDeclarationGroupRef : str) |
| 149 | + |
| 150 | + Same as :ref:`ar4_datatype_DataTypeMappingSet_getModeRequestMapping` but instead returns the reference to the mapped implementation data type. |
| 151 | + Returns None in case the mode declaration group reference is not part of the internal modeRequestMap dictionary. |
| 152 | + |
| 153 | + :param str applicationDataTypeRef: :ref:`ar4_mode_ModeDeclarationGroup` |
| 154 | + :rtype: str |
| 155 | + |
| 156 | +.. _ar4_datatype_DataTypeMappingSet_findMappedDataType: |
| 157 | + |
| 158 | +findMappedDataType |
| 159 | +~~~~~~~~~~~~~~~~~~~~~ |
| 160 | + |
| 161 | +.. method:: DataTypeMappingSet.findMappedDataType(applicationDataTypeRef : str) |
| 162 | + |
| 163 | + Same as :ref:`ar4_datatype_DataTypeMappingSet_findMappedDataTypeRef` but instead returns the |
| 164 | + referenced to :ref:`ar4_datatype_ImplementationDataType` object. |
| 165 | + |
| 166 | + :param str applicationDataTypeRef: Reference to a :ref:`ar4_datatype_ApplicationDataType` |
| 167 | + :rtype: :ref:`ar4_datatype_ImplementationDataType` |
| 168 | + |
| 169 | +.. _ar4_datatype_DataTypeMappingSet_findMappedModeRequest: |
| 170 | + |
| 171 | +findMappedModeRequest |
| 172 | +~~~~~~~~~~~~~~~~~~~~~ |
| 173 | + |
| 174 | +.. method:: DataTypeMappingSet.findMappedModeRequest(modeDeclarationGroupRef : str) |
| 175 | + |
| 176 | + Same as :ref:`ar4_datatype_DataTypeMappingSet_findMappedModeRequestRef` but instead returns the |
| 177 | + referenced to :ref:`ar4_datatype_ImplementationDataType` object. |
| 178 | + |
| 179 | + :param str modeDeclarationGroupRef: Reference to a :ref:`ar4_mode_ModeDeclarationGroup` |
| 180 | + :rtype: :ref:`ar4_datatype_ImplementationDataType` |
0 commit comments