Changeset 121:df979afffcfc in finroc_plugins_data_ports


Ignore:
Timestamp:
11.08.2017 19:24:41 (2 years ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Phase:
public
Message:

Sets up mechanism to always connect numeric types (with warning if appropriate) to retain backward-compatibility with the 14.08 release

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • common/tAbstractDataPort.cpp

    r114 r121  
    4040#include "plugins/data_ports/type_traits.h" 
    4141#include "plugins/data_ports/common/tConversionConnector.h" 
     42#include "plugins/data_ports/numeric/tNumber.h" 
    4243 
    4344//---------------------------------------------------------------------- 
     
    8081  port_listener(nullptr) 
    8182{ 
     83  AddNumericTypeToLegacyImplicitConversion(rrlib::rtti::tDataType<numeric::tNumber>()); 
    8284} 
    8385 
  • common/tAbstractDataPort.h

    r118 r121  
    8585 
    8686  tAbstractDataPort(const tAbstractDataPortCreationInfo& create_info); 
     87 
     88  /*! 
     89   * Adds type to group of numeric types that can always be converted implicitly when connecting ports of such types. 
     90   * This temporary mechanism is introduced to retain backward-compatibility with Finroc 14.08 - where all these types used tNumber type in port backend and could be connected. 
     91   * It is planned to remove this mechanism in future Finroc releases - and a respective warning is displayed for connections that need to be changed. 
     92   * 
     93   * \param type Data type to add 
     94   */ 
     95  static void AddNumericTypeToLegacyImplicitConversion(const rrlib::rtti::tType& type) 
     96  { 
     97    tAbstractPort::AddNumericTypeToLegacyImplicitConversion(type); 
     98  } 
    8799 
    88100  /*! 
  • tPort.h

    r119 r121  
    145145        creation_info.GetDefault(t); 
    146146        SetDefault(t); 
     147      } 
     148      if (IsNumeric<T>::value) 
     149      { 
     150        common::tAbstractDataPort::AddNumericTypeToLegacyImplicitConversion(creation_info.data_type); 
    147151      } 
    148152    } 
Note: See TracChangeset for help on using the changeset viewer.