Changeset 93:f23cec48f874 in finroc_plugins_parameters


Ignore:
Timestamp:
25.05.2020 22:34:08 (6 weeks ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Tags:
tip
Message:

Adds ConnectTo method to tParameter class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tParameter.h

    r78 r93  
    141141 
    142142  /*! 
     143   * Connect parameter (see tPortWrapperBase.h for variants) 
     144   */ 
     145  template <typename TPartner, typename ... TRest> 
     146  inline void ConnectTo(TPartner& partner, const TRest& ... rest) 
     147  { 
     148    implementation.ConnectTo(AsPort(partner), rest...); 
     149  } 
     150 
     151  /*! 
    143152   * Gets parameter's current value. 
    144153   * (only available for 'cheaply copied' types) 
     
    271280//---------------------------------------------------------------------- 
    272281private: 
     282 
     283  template <typename U> 
     284  core::tPortWrapperBase AsPort(tParameter<U>& parameter) 
     285  { 
     286    return parameter.GetWrapped(); 
     287  } 
     288 
     289  core::tPortWrapperBase AsPort(core::tPortWrapperBase port) 
     290  { 
     291    return port; 
     292  } 
    273293 
    274294  /*! Parameter implementation */ 
Note: See TracChangeset for help on using the changeset viewer.