Changeset 34:8fc7f3c50c2e in rrlib_rtti_conversion


Ignore:
Timestamp:
15.04.2020 07:41:22 (20 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Children:
35:564e44d5070d, 36:fc2bc404fdb5
Phase:
public
Message:

Adapts type checks of static cast operations to changeset c8365294522d to handle all possible combinations (relaxes checks, as single operation may include cast to underlying type before)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tStaticCastOperation.h

    r30 r34  
    8282    static void ConvertFinal(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation) 
    8383    { 
    84       (*destination_object.GetUnchecked<TDestination>()) = static_cast<TDestination>(*source_object.Get<TSource>()); 
     84      (*destination_object.GetUnchecked<TDestination>()) = static_cast<TDestination>(*source_object.GetUnchecked<TSource>()); 
    8585    } 
    8686 
    8787    static void ConvertFirst(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation) 
    8888    { 
    89       TDestination intermediate = static_cast<TDestination>(*source_object.Get<TSource>()); 
     89      TDestination intermediate = static_cast<TDestination>(*source_object.GetUnchecked<TSource>()); 
    9090      operation.Continue(tTypedConstPointer(&intermediate, operation.compiled_operation.IntermediateType()), destination_object); 
    9191    } 
     
    141141    static tTypedConstPointer GetDestinationReference(const tTypedConstPointer& source_object, const tCurrentConversionOperation& operation) 
    142142    { 
    143       return tTypedConstPointer(&static_cast<const TDestination&>(*source_object.Get<TSource>())); 
     143      return tTypedConstPointer(&static_cast<const TDestination&>(*source_object.GetUnchecked<TSource>())); 
    144144    } 
    145145 
    146146    static void ConvertFirst(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation) 
    147147    { 
    148       const TDestination& intermediate = static_cast<const TDestination&>(*source_object.Get<TSource>()); 
     148      const TDestination& intermediate = static_cast<const TDestination&>(*source_object.GetUnchecked<TSource>()); 
    149149      operation.Continue(tTypedConstPointer(&intermediate), destination_object); 
    150150    } 
     
    166166    static void ConvertFinal(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation) 
    167167    { 
    168       const std::vector<TSource>& source = *source_object.Get<std::vector<TSource>>(); 
     168      const std::vector<TSource>& source = *source_object.GetUnchecked<std::vector<TSource>>(); 
    169169      std::vector<TDestination>& destination = *destination_object.GetUnchecked<std::vector<TDestination>>(); 
    170170      destination.resize(source.size()); 
     
    178178    static void ConvertFirst(const tTypedConstPointer& source_object, const tTypedPointer& destination_object, const tCurrentConversionOperation& operation) 
    179179    { 
    180       const std::vector<TSource>& source = *source_object.Get<std::vector<TSource>>(); 
     180      const std::vector<TSource>& source = *source_object.GetUnchecked<std::vector<TSource>>(); 
    181181      std::vector<TDestination> intermediate; 
    182182      intermediate.resize(source.size()); 
Note: See TracChangeset for help on using the changeset viewer.