Changeset 116:a842f5afb76b in finroc_plugins_data_ports


Ignore:
Timestamp:
08.08.2017 16:30:38 (2 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
14.08
Children:
124:ca459cc011c8, 125:caccc7482091, 133:fb0f074ccf14
Phase:
public
Message:

Backed out last changes due to incompatibility with gcc 4.8.4 on Ubuntu 14.04

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tPortPack.h

    r108 r116  
    7777{ 
    7878 
    79   template <bool value, typename> 
    80   using CheckIterators = std::integral_constant<bool, value>; 
    81  
    8279//---------------------------------------------------------------------- 
    8380// Public methods and typedefs 
     
    9289  } 
    9390 
    94   template <typename TIterator, typename std::enable_if<CheckIterators<(Tsize> 1), TIterator>::value, int>::type = 0 > 
    95       inline tPortPack(core::tFrameworkElement *parent, TIterator names_begin, TIterator names_end) : 
    96         tPortPack < TPort, TTypeList, Tsize - 1 > (parent, names_begin, names_end - 1), 
    97         port(*(names_end - 1), parent) 
    98   { 
    99     this->port.Init(); 
    100   } 
    101  
    102   template <typename TIterator, typename std::enable_if<CheckIterators<(Tsize == 1), TIterator>::value, int>::type = 0> 
     91  template <typename TIterator> 
    10392  inline tPortPack(core::tFrameworkElement *parent, TIterator names_begin, TIterator names_end) : 
    104     tPortPack < TPort, TTypeList, Tsize - 1 > (parent, *names_begin), 
    105     port(*names_begin, parent) 
     93    tPortPack < TPort, TTypeList, Tsize - 1 > (parent, names_begin, names_end - 1), 
     94    port(names_end - 1, parent) 
    10695  { 
    10796    this->port.Init(); 
     
    145134  inline tPortPack(core::tFrameworkElement *parent, const std::string &name_prefix) 
    146135  {} 
    147  
    148   template <typename TIterator> 
    149   inline tPortPack(core::tFrameworkElement *parent, TIterator names_begin, TIterator names_end) 
    150   {} 
    151  
    152136  inline core::tPortWrapperBase &GetPort(size_t index) 
    153137  { 
  • tests/test_collection.cpp

    r112 r116  
    4444#include "plugins/data_ports/tProxyPort.h" 
    4545#include "plugins/data_ports/tThreadLocalBufferManagement.h" 
    46 #include "plugins/data_ports/tPortPack.h" 
    4746 
    4847//---------------------------------------------------------------------- 
     
    243242  RRLIB_UNIT_TESTS_BEGIN_SUITE(DataPortsTestCollection); 
    244243  RRLIB_UNIT_TESTS_ADD_TEST(Test); 
    245   RRLIB_UNIT_TESTS_ADD_TEST(PortPack); 
    246244  RRLIB_UNIT_TESTS_END_SUITE; 
    247245 
     
    259257    TestPortListeners<int>(1); 
    260258  } 
    261  
    262   void PortPack() 
    263   { 
    264     auto parent = new core::tFrameworkElement(&core::tRuntimeEnvironment::GetInstance(), "TestPortPack"); 
    265  
    266     using tTypeList = rrlib::util::tTypeList<int, double, std::string, bool>; 
    267     data_ports::tPortPack<tInputPort, tTypeList> ports(parent, "X"); 
    268  
    269     RRLIB_UNIT_TESTS_EQUALITY(tTypeList::cSIZE, ports.NumberOfPorts()); 
    270  
    271     for (size_t i = 0; i < tTypeList::cSIZE; ++i) 
    272     { 
    273       RRLIB_UNIT_TESTS_EQUALITY("X" + std::to_string(i + 1), ports.GetPort(i).GetName()); 
    274     } 
    275  
    276     std::array<std::string, tTypeList::cSIZE> names {"foo", "bar", "baz", "fnord"}; 
    277     data_ports::tPortPack<tInputPort, tTypeList> named_ports(parent, names.begin(), names.end()); 
    278  
    279     for (size_t i = 0; i < tTypeList::cSIZE; ++i) 
    280     { 
    281       RRLIB_UNIT_TESTS_EQUALITY(names[i], named_ports.GetPort(i).GetName()); 
    282     } 
    283   } 
    284259}; 
    285260 
Note: See TracChangeset for help on using the changeset viewer.