DataTypeMappingSet

XML tag <DATA-TYPE-MAPPING-SET>
Module autosar.datatype
Inherits autosar.element.Element

This class contains type mappings between ApplicationDataTypes and ImplementationDataTypes. In addition, it can contain type mappings between ModeDeclarationGroups and ImplementationDataTypes.

Attributes

For inherited attributes see autosar.element.Element.

Name Type Description
applicationTypeMap dict Application data type mappings
modeRequestMap dict Mode request mappings

The ARXML definition uses lists containing mappings while Python uses dictionaries. For the applicationTypeMap dictionary, each key is a reference to an application data type and each value is a reference to an implementation data type. Likewise for the modeRequestMap dictionary, each key is a reference to a mode declaration group and each value is a reference to an implementation data type.

Method Description

createDataTypeMapping

DataTypeMappingSet.createDataTypeMapping(applicationDataTypeRef : str, implementationDataTypeRef : str)

Creates a new type mapping between an application type (reference) and implementation data type (reference). The created mapping is added to the internal applicationTypeMap dictionary.

Parameters:
  • applicationDataTypeRef (str) – Reference to an ApplicationDataType
  • implementationDataTypeRef (str) – Reference to an ImplementationDataType

createModeRequestMapping

DataTypeMappingSet.createModeRequestMapping(modeDeclarationGroupRef : str, implementationDataTypeRef : str)

Creates a new type mapping between a mode declaration group (reference) and implementation data type (reference). The created mapping is added to the internal modeRequestMap dictionary.

Parameters:

add

DataTypeMappingSet.add(item)

Adds a user-created mapping to this mapping set. If the item is of type DataTypeMap it gets inserted into to the applicationTypeMap dictionary. Likewise, if the item is of type ModeRequestTypeMap it gets inserted into to the modeRequestMap dictionary.

Parameters:item (DataTypeMap or ModeRequestTypeMap) – Reference to an ApplicationDataType

getDataTypeMapping

DataTypeMappingSet.getDataTypeMapping(applicationDataTypeRef : str)

Returns the mapping object that is currently associated with the given application data type reference. If the reference string is not found in the internal applicationTypeMap dictionary, None is returned.

Parameters:applicationDataTypeRef (str) – Reference to an ApplicationDataType
Return type:DataTypeMappingSet or None

getModeRequestMapping

DataTypeMappingSet.getModeRequestMapping(modeDeclarationGroupRef : str)

Returns the mapping object that is currently associated with the given mode declaration group reference. If the reference string is not found in the internal modeRequestMap dictionary, None is returned.

Parameters:modeDeclarationGroupRef (str) – Reference to a
Return type:ModeDeclarationGroup or None

findMappedDataTypeRef

DataTypeMappingSet.findMappedDataTypeRef(applicationDataTypeRef : str)

Same as getDataTypeMapping but instead returns the reference to the mapped implementation data type. Returns None in case the application data type reference is not part of the internal applicationTypeMap dictionary.

Parameters:applicationDataTypeRef (str) – Reference to an ApplicationDataType
Return type:str

findMappedModeRequestRef

DataTypeMappingSet.findMappedModeRequestRef(modeDeclarationGroupRef : str)

Same as getModeRequestMapping but instead returns the reference to the mapped implementation data type. Returns None in case the mode declaration group reference is not part of the internal modeRequestMap dictionary.

param str applicationDataTypeRef:
 ModeDeclarationGroup
rtype:str

findMappedDataType

DataTypeMappingSet.findMappedDataType(applicationDataTypeRef : str)

Same as findMappedDataTypeRef but instead returns the referenced to ImplementationDataType object.

param str applicationDataTypeRef:
 Reference to a ApplicationDataType
rtype:ImplementationDataType

findMappedModeRequest

DataTypeMappingSet.findMappedModeRequest(modeDeclarationGroupRef : str)

Same as findMappedModeRequestRef but instead returns the referenced to ImplementationDataType object.

Parameters:modeDeclarationGroupRef (str) – Reference to a ModeDeclarationGroup
Return type:ImplementationDataType