Changeset 144:52bef7d9c430 in finroc_plugins_data_ports


Ignore:
Timestamp:
08.08.2019 12:16:52 (2 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
default
Parents:
142:fbf566b7209e (diff), 143:d5ea7a4f9bbf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Tags:
tip
Message:

Merge with 17.03

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tPortPack.h

    r139 r144  
    9292   * \param parent        The parent framework element 
    9393   * \param name_prefix   The common prefix used for all port names 
    94    */ 
    95   inline tPortPack(core::tFrameworkElement *parent, const std::string &name_prefix) 
    96   { 
    97     this->DispatchInitializer(parent, tIndex(), [&name_prefix](size_t i) 
    98     { 
    99       return name_prefix + std::to_string(i); 
     94   * \param first_index   First port's index (Default is zero so ports have the same index as in source code) 
     95   */ 
     96  inline tPortPack(core::tFrameworkElement *parent, const std::string &name_prefix, size_t first_index = 0) 
     97  { 
     98    this->DispatchInitializer(parent, tIndex(), [&name_prefix, first_index](size_t i) 
     99    { 
     100      return name_prefix + std::to_string(i + first_index); 
    100101    }); 
    101102  } 
     
    213214protected: 
    214215 
    215   /*! Ctor with common port name prefix and port number offset to support legacy code 
    216    * 
    217    * The port names will follow the scheme "<prefix> [<offset>..]" 
    218    * 
    219    * \param parent        The parent framework element 
    220    * \param name_prefix   The common prefix used for all port names 
    221    * \param offset        Offset for numbering the created ports 
    222    */ 
    223   inline tPortPack(core::tFrameworkElement *parent, const std::string &name_prefix, size_t offset) 
    224   { 
    225     this->DispatchInitializer(parent, tIndex(), [&name_prefix, offset](size_t i) 
    226     { 
    227       return name_prefix + std::to_string(i + offset); 
    228     }); 
    229   } 
    230216 
    231217//---------------------------------------------------------------------- 
  • tests/test_collection.cpp

    r139 r144  
    380380void PortPackTestHelper(core::tFrameworkElement *parent, const std::initializer_list<NAMES> &names_initializer) 
    381381{ 
    382   data_ports::tPortPack<mTestModule::tInput, T...> ports(parent, "X"); 
     382  data_ports::tPortPack<mTestModule::tInput, T...> ports(parent, "X", 0); 
    383383 
    384384  RRLIB_UNIT_TESTS_EQUALITY(sizeof...(T), ports.NumberOfPorts()); 
Note: See TracChangeset for help on using the changeset viewer.