Changeset 318:ab5731e784df in finroc_core-java


Ignore:
Timestamp:
20.05.2019 10:51:34 (5 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Children:
319:8f371733151d, 324:69d6eb603813
Phase:
public
Message:

Adds support for 'INHERITS_UNDERLYING_TYPE_ELEMENT_ACCESS_OPERATIONS' flag of UnderlyingType type trait. This allows to use built-in element access operation '[]' for e.g. rrlib_math vectors also.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remote/RemoteRuntime.java

    r315 r318  
    323323        RemoteTypeConversion arrayToListOperation = getTypeConversionOperation(RemoteTypeConversion.SupportedTypeFilter.ARRAY_TO_VECTOR); 
    324324        RemoteTypeConversion getTupleElementOperation = getTypeConversionOperation(RemoteTypeConversion.SupportedTypeFilter.GET_TUPLE_ELEMENT); 
    325         if (sourceType.getTypeClassification() == DataTypeBase.CLASSIFICATION_LIST || sourceType.getTypeClassification() == DataTypeBase.CLASSIFICATION_ARRAY) { 
    326             fromSourceType.add(new GetCastOperationEntry(getListElementOperation, remoteTypes.get(sourceType.getElementType()), false)); 
     325        RemoteType underlyingInheritOperationsType = sourceType; 
     326        while ((underlyingInheritOperationsType.getTypeTraits() & DataTypeBase.INHERITS_UNDERLYING_TYPE_ELEMENT_ACCESS_OPERATIONS) != 0 && underlyingInheritOperationsType.getTypeClassification() != DataTypeBase.CLASSIFICATION_ARRAY && underlyingInheritOperationsType.getUnderlyingType() != 0) { 
     327            underlyingInheritOperationsType = remoteTypes.get(underlyingInheritOperationsType.getUnderlyingType()); 
     328        } 
     329        if (sourceType.getTypeClassification() == DataTypeBase.CLASSIFICATION_LIST || underlyingInheritOperationsType.getTypeClassification() == DataTypeBase.CLASSIFICATION_ARRAY) { 
     330            fromSourceType.add(new GetCastOperationEntry(getListElementOperation, remoteTypes.get(underlyingInheritOperationsType.getElementType()), false)); 
    327331        } 
    328332        if (sourceType.getTypeClassification() == DataTypeBase.CLASSIFICATION_ARRAY) { 
Note: See TracChangeset for help on using the changeset viewer.