Changeset 49:cdd4cf3eda0c in rrlib_rtti_conversion for tConversionOperationSequence.cpp


Ignore:
Timestamp:
08.02.2022 07:22:43 (12 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Tags:
tip
Message:

Allows to specify destination object pointer type passed to Convert function. Custom types may allow conversion operations to provide additional information (timestamps are an example).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tConversionOperationSequence.cpp

    r46 r49  
    144144} 
    145145 
    146 tCompiledConversionOperation tConversionOperationSequence::Compile(bool allow_reference_to_source, const tType& source_type, const tType& destination_type) const 
     146tCompiledConversionOperation tConversionOperationSequence::Compile(bool allow_reference_to_source, const tType& source_type, const tType& destination_type, const std::type_info& destination_pointer_type) const 
    147147{ 
    148148  // ############ 
     
    406406  result.destination_type = last_conversion->destination_type; 
    407407  static_cast<tConversionOperationSequence&>(result).intermediate_type = this->intermediate_type; 
     408  result.destination_pointer_type = &(first_operation == &cFOR_EACH_OPERATION ? typeid(tTypedPointer) : destination_pointer_type);  // Special For-Each operation works with standard typed pointers only 
    408409 
    409410  // Handle special case: only const offsets 
Note: See TracChangeset for help on using the changeset viewer.