Skip to content

Commit 7fc44a0

Browse files
committed
More bind cleanup
1 parent 3686d87 commit 7fc44a0

File tree

16 files changed

+40
-60
lines changed

16 files changed

+40
-60
lines changed

src/Core/Algorithms/Visualization/OsprayDataAlgorithm.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include <Core/Algorithms/Visualization/OsprayDataAlgorithm.h>
3030
#include <Core/Datatypes/Geometry.h>
31-
#include <Core/Datatypes/String.h>
3231
#include <Core/Datatypes/Legacy/Field/VField.h>
3332
#include <Core/Datatypes/ColorMap.h>
3433
#include <Core/Datatypes/Legacy/Field/Field.h>
@@ -40,13 +39,10 @@
4039
#include <Core/Algorithms/Base/AlgorithmPreconditions.h>
4140

4241
#include <boost/date_time/posix_time/posix_time.hpp>
43-
#include <boost/utility.hpp>
4442
#include <boost/graph/topological_sort.hpp>
4543
#include <boost/graph/undirected_dfs.hpp>
46-
#include <boost/cstdlib.hpp>
4744
#include <boost/graph/copy.hpp>
4845
#include <boost/graph/connected_components.hpp>
49-
#include <boost/lambda/lambda.hpp>
5046

5147
#include <Core/Logging/Log.h>
5248
#include <spdlog/fmt/ostr.h>

src/Core/Logging/Logger.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ScopedTimeRemarker::ScopedTimeRemarker(LegacyLoggerInterface* log, const std::st
4343
ScopedTimeRemarker::~ScopedTimeRemarker()
4444
{
4545
std::ostringstream perf;
46-
perf << label_ << " took " << timer_.elapsed() << " seconds." << std::endl;
46+
perf << label_ << " took " << timer_.elapsed().wall << " seconds." << std::endl;
4747
log_->status(perf.str());
4848
}
4949

@@ -55,7 +55,7 @@ ScopedTimeLogger::ScopedTimeLogger(const std::string& label, bool shouldLog): la
5555

5656
ScopedTimeLogger::~ScopedTimeLogger()
5757
{
58-
auto time = timer_.elapsed();
58+
auto time = timer_.elapsed().wall;
5959
if (shouldLog_)
6060
LOG_DEBUG("{} took {} seconds.", label_, time);
6161
}

src/Core/Logging/ScopedTimeRemarker.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define CORE_LOGGING_SCOPEDTIMEREMARKER_H
3333

3434
#include <string>
35-
#include <boost/timer.hpp>
35+
#include <boost/timer/timer.hpp>
3636
#include <Core/Logging/LoggerFwd.h>
3737
#include <Core/Logging/share.h>
3838

@@ -50,7 +50,7 @@ namespace SCIRun
5050
private:
5151
LegacyLoggerInterface* log_;
5252
std::string label_;
53-
boost::timer timer_;
53+
boost::timer::cpu_timer timer_;
5454
};
5555

5656
class SCISHARE ScopedTimeLogger
@@ -61,7 +61,7 @@ namespace SCIRun
6161
private:
6262
std::string label_;
6363
bool shouldLog_;
64-
boost::timer timer_;
64+
boost::timer::cpu_timer timer_;
6565
};
6666
}
6767
}

src/Dataflow/Engine/Controller/NetworkEditorController.cc

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
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>
@@ -45,8 +45,6 @@
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
282280
ModuleHandle 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

792790
void 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

src/Dataflow/Engine/Scheduler/DynamicExecutor/WorkUnitExecutor.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
#include <Dataflow/Engine/Scheduler/DynamicExecutor/WorkUnitProducerInterface.h>
3333
#include <Dataflow/Network/NetworkInterface.h>
34-
#include <Core/Logging/Log.h>
3534
#include <Dataflow/Engine/Scheduler/share.h>
3635

3736
namespace SCIRun {
@@ -42,27 +41,19 @@ namespace SCIRun {
4241
struct SCISHARE ModuleExecutor
4342
{
4443
ModuleExecutor(Networks::ModuleHandle mod, const Networks::ExecutableLookup* lookup, ProducerInterfacePtr producer) :
45-
module_(mod), lookup_(lookup), producer_(producer),
46-
shouldLog_(false)//SCIRun::Core::Logging::Log::get().verbose())
44+
module_(mod), lookup_(lookup), producer_(producer)
4745
{
48-
//Core::Logging::Log::get("executor").setVerbose(shouldLog_);
4946
}
5047
void run() const
5148
{
52-
//log_->trace_if(shouldLog_, "Module Executor: {}", module_->get_id().id_);
53-
auto exec = lookup_->lookupExecutable(module_->id());
54-
boost::signals2::scoped_connection s(exec->connectExecuteEnds([this]
55-
{
56-
producer_->enqueueReadyModules();
57-
}));
49+
auto* exec = lookup_->lookupExecutable(module_->id());
50+
boost::signals2::scoped_connection s(exec->connectExecuteEnds([this](double, const Networks::ModuleId&) { producer_->enqueueReadyModules(); }));
5851
exec->executeWithSignals();
5952
}
6053

6154
Networks::ModuleHandle module_;
6255
const Networks::ExecutableLookup* lookup_;
6356
ProducerInterfacePtr producer_;
64-
bool shouldLog_;
65-
//static Core::Logging::Logger2 log_;
6657
};
6758

6859

src/Dataflow/Engine/Scheduler/GraphNetworkAnalyzer.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <boost/graph/topological_sort.hpp>
3838
#include <boost/graph/copy.hpp>
3939
#include <boost/graph/connected_components.hpp>
40-
#include <boost/lambda/lambda.hpp>
4140

4241
using namespace SCIRun::Dataflow::Engine;
4342
using namespace SCIRun::Dataflow::Engine::NetworkGraph;

src/Dataflow/Engine/Scheduler/SchedulerInterfaces.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@
2828

2929
#include <Dataflow/Engine/Scheduler/SchedulerInterfaces.h>
3030
#include <Dataflow/Network/NetworkInterface.h>
31-
#include <boost/lambda/core.hpp>
3231
#include <Core/Logging/Log.h>
3332

3433
using namespace SCIRun::Dataflow::Engine;
3534
using namespace SCIRun::Dataflow::Networks;
3635

37-
ScopedExecutionBoundsSignaller::ScopedExecutionBoundsSignaller(const ExecutionBounds* bounds, boost::function<int()> errorCodeRetriever) : bounds_(bounds), errorCodeRetriever_(errorCodeRetriever)
36+
ScopedExecutionBoundsSignaller::ScopedExecutionBoundsSignaller(const ExecutionBounds* bounds, std::function<int()> errorCodeRetriever) : bounds_(bounds), errorCodeRetriever_(errorCodeRetriever)
3837
{
3938
bounds_->executeStarts_();
4039
}
@@ -59,7 +58,7 @@ const ExecutionBounds& ExecutionContext::bounds() const
5958

6059
void ExecutionContext::preexecute()
6160
{
62-
network_.setExpandedModuleExecutionState(ModuleExecutionState::NotExecuted, boost::lambda::constant(true));
61+
network_.setExpandedModuleExecutionState(ModuleExecutionState::NotExecuted, [](ModuleHandle) { return true; });
6362
network_.setModuleExecutionState(ModuleExecutionState::Waiting, additionalFilter_);
6463
}
6564

src/Dataflow/Engine/Scheduler/SchedulerInterfaces.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ namespace Engine {
6363
class SCISHARE ScopedExecutionBoundsSignaller
6464
{
6565
public:
66-
ScopedExecutionBoundsSignaller(const ExecutionBounds* bounds, boost::function<int()> errorCodeRetriever);
66+
ScopedExecutionBoundsSignaller(const ExecutionBounds* bounds, std::function<int()> errorCodeRetriever);
6767
~ScopedExecutionBoundsSignaller();
6868
private:
6969
const ExecutionBounds* bounds_;
70-
boost::function<int()> errorCodeRetriever_;
70+
std::function<int()> errorCodeRetriever_;
7171
};
7272

7373
struct SCISHARE ExecutionContext : boost::noncopyable

src/Dataflow/Network/ExecutableObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace Networks {
4646
class SCISHARE ExecutableObject
4747
{
4848
public:
49-
virtual ~ExecutableObject() {}
49+
virtual ~ExecutableObject() = default;
5050
virtual bool executeWithSignals() = 0;
5151

5252
virtual boost::signals2::connection connectExecuteBegins(const ExecuteBeginsSignalType::slot_type& subscriber) = 0;

src/Dataflow/Network/NetworkFwd.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
#define DATAFLOW_NETWORK_NETWORK_FWD_H
3434

3535
#include <Core/Utils/SmartPointers.h>
36-
#include <boost/function.hpp>
37-
#include <boost/any.hpp>
36+
#include <string>
3837
#include <map>
3938

4039

@@ -103,9 +102,9 @@ typedef SharedPointer<DisabledComponents> DisabledComponentsHandle;
103102
typedef SharedPointer<NetworkFile> NetworkFileHandle;
104103
typedef SharedPointer<Subnetworks> SubnetworksHandle;
105104

106-
typedef std::map<std::string, std::map<std::string, std::map<std::string, ModuleDescription>>> ModuleDescriptionMap;
107-
typedef boost::function<bool(ModuleHandle)> ModuleFilter;
108-
using ConnectionFilter = boost::function<bool(const ConnectionDescription&)>;
105+
using ModuleDescriptionMap = std::map<std::string, std::map<std::string, std::map<std::string, ModuleDescription>>>;
106+
using ModuleFilter = std::function<bool(ModuleHandle)>;
107+
using ConnectionFilter = std::function<bool(const ConnectionDescription&)>;
109108

110109
}}}
111110

0 commit comments

Comments
 (0)