2828
2929// / @todo Documentation Dataflow/Engine/Controller/NetworkEditorController.cc
3030
31- #include < iostream >
31+ #include < boost/foreach.hpp >
3232#include < Dataflow/Engine/Controller/NetworkEditorController.h>
3333
3434#include < Dataflow/Network/Connection.h>
4545#include < boost/algorithm/string/predicate.hpp>
4646#include < boost/algorithm/string/split.hpp>
4747#include < boost/algorithm/string/classification.hpp>
48- #include < boost/lambda/lambda.hpp>
49- #include < boost/foreach.hpp>
5048
5149#ifdef BUILD_WITH_PYTHON
5250#include < Dataflow/Engine/Python/NetworkEditorPythonAPI.h>
@@ -273,7 +271,7 @@ namespace
273271 InputPortHandle getFirstAvailableDynamicPortWithName (ModuleHandle mod, const std::string& name)
274272 {
275273 auto ports = mod->findInputPortsWithName (name);
276- auto firstEmptyDynamicPortWithName = std::find_if (ports.begin (), ports.end (),
274+ const auto firstEmptyDynamicPortWithName = std::find_if (ports.begin (), ports.end (),
277275 [](InputPortHandle iport) { return iport->nconnections () == 0 ; });
278276 return firstEmptyDynamicPortWithName != ports.end () ? *firstEmptyDynamicPortWithName : nullptr ;
279277 }
@@ -282,7 +280,7 @@ namespace
282280ModuleHandle NetworkEditorController::duplicateModule (const ModuleHandle& module )
283281{
284282 ENSURE_NOT_NULL (module , " Cannot duplicate null module" );
285- auto id (module ->id ());
283+ const auto id (module ->id ());
286284 auto newModule = addModuleImpl (module ->info ());
287285 newModule->setState (module ->get_state ()->clone ());
288286 static ModuleCounter dummy;
@@ -353,16 +351,16 @@ ModuleHandle NetworkEditorController::insertNewModule(const PortDescriptionInter
353351{
354352 auto newMod = connectNewModule (portToConnect, info.newModuleName );
355353
356- auto endModule = theNetwork_->lookupModule (ModuleId (info.endModuleId ));
354+ const auto endModule = theNetwork_->lookupModule (ModuleId (info.endModuleId ));
357355
358356 auto newModOutputPorts = newMod->outputPorts ();
359- auto firstMatchingOutputPort = std::find_if (newModOutputPorts.begin (), newModOutputPorts.end (),
357+ const auto firstMatchingOutputPort = std::find_if (newModOutputPorts.begin (), newModOutputPorts.end (),
360358 [&](OutputPortHandle oport) { return oport->get_typename () == portToConnect->get_typename (); }
361359 );
362360
363361 if (firstMatchingOutputPort != newModOutputPorts.end ())
364362 {
365- auto newOutputPortToConnectFrom = *firstMatchingOutputPort;
363+ const auto newOutputPortToConnectFrom = *firstMatchingOutputPort;
366364
367365 auto endModuleInputPortOptions = endModule->findInputPortsWithName (info.inputPortName );
368366 if (!endModuleInputPortOptions.empty ())
@@ -371,19 +369,19 @@ ModuleHandle NetworkEditorController::insertNewModule(const PortDescriptionInter
371369
372370 if (!firstPort->isDynamic ()) // easy case
373371 {
374- auto connId = firstPort->connection (0 )->id_ ;
372+ const auto connId = firstPort->connection (0 )->id_ ;
375373 removeConnection (connId);
376374 requestConnection (newOutputPortToConnectFrom.get (), firstPort.get ());
377375 }
378376 else // dynamic: match portId exactly, remove, then retrieve list again to find first empty dynamic port of same name.
379377 {
380- auto exactMatch = std::find_if (endModuleInputPortOptions.begin (), endModuleInputPortOptions.end (),
378+ const auto exactMatch = std::find_if (endModuleInputPortOptions.begin (), endModuleInputPortOptions.end (),
381379 [&](InputPortHandle iport) { return iport->id ().toString () == info.inputPortId ; });
382380 if (exactMatch != endModuleInputPortOptions.end ())
383381 {
384- auto connId = (*exactMatch)->connection (0 )->id_ ;
382+ const auto connId = (*exactMatch)->connection (0 )->id_ ;
385383 removeConnection (connId);
386- auto firstEmptyDynamicPortWithName = getFirstAvailableDynamicPortWithName (endModule, info.inputPortName );
384+ const auto firstEmptyDynamicPortWithName = getFirstAvailableDynamicPortWithName (endModule, info.inputPortName );
387385 if (firstEmptyDynamicPortWithName)
388386 {
389387 requestConnection (newOutputPortToConnectFrom.get (), firstEmptyDynamicPortWithName.get ());
@@ -410,10 +408,10 @@ boost::optional<ConnectionId> NetworkEditorController::requestConnection(const P
410408 ENSURE_NOT_NULL (from, " from port" );
411409 ENSURE_NOT_NULL (to, " to port" );
412410
413- auto out = from->isInput () ? to : from;
414- auto in = from->isInput () ? from : to;
411+ const auto out = from->isInput () ? to : from;
412+ const auto in = from->isInput () ? from : to;
415413
416- ConnectionDescription desc (
414+ const ConnectionDescription desc (
417415 OutgoingConnectionDescription (out->getUnderlyingModuleId (), out->id ()),
418416 IncomingConnectionDescription (in->getUnderlyingModuleId (), in->id ()));
419417
@@ -791,7 +789,7 @@ void NetworkEditorController::updateModulePositions(const ModulePositions& modul
791789
792790void NetworkEditorController::cleanUpNetwork ()
793791{
794- auto all = boost::lambda::constant ( true ) ;
792+ auto all = [](ModuleHandle) { return true ; } ;
795793 NetworkGraphAnalyzer analyze (*theNetwork_, all, true );
796794 auto connected = analyze.connectedComponents ();
797795
0 commit comments