Skip to content

Commit

Permalink
replaced boost::bind for std::bind
Browse files Browse the repository at this point in the history
  • Loading branch information
camolezi committed Jun 9, 2020
1 parent 26a50d0 commit 75a1f51
Show file tree
Hide file tree
Showing 43 changed files with 254 additions and 233 deletions.
4 changes: 2 additions & 2 deletions Fireworks/Core/src/CSGContinuousAction.cc
Expand Up @@ -11,7 +11,7 @@
//

// system include files
#include <boost/bind.hpp>
#include <functional>
#include "TGMenu.h"

// user include files
Expand All @@ -38,7 +38,7 @@ CSGContinuousAction::CSGContinuousAction(CSGActionSupervisor* iSupervisor, const
m_runningDownPic(nullptr),
m_button(nullptr),
m_isRunning(false) {
activated.connect(boost::bind(&CSGContinuousAction::switchMode, this));
activated.connect(std::bind(&CSGContinuousAction::switchMode, this));
}

void CSGContinuousAction::createCustomIconsButton(TGCompositeFrame* p,
Expand Down
8 changes: 4 additions & 4 deletions Fireworks/Core/src/CmsShowCommon.cc
Expand Up @@ -11,7 +11,7 @@
//

// system include files
#include <boost/bind.hpp>
#include <functional>
#include <iostream>
// user include files

Expand Down Expand Up @@ -69,10 +69,10 @@ CmsShowCommon::CmsShowCommon(fireworks::Context* c)
new FWLongParameter(this, name, long(colorManager()->geomColor(FWGeomColorIndex(i))), 1000l, 1100l);
}

m_trackBreak.changed_.connect(boost::bind(&CmsShowCommon::setTrackBreakMode, this));
m_trackBreak.changed_.connect(std::bind(&CmsShowCommon::setTrackBreakMode, this));
m_palette.set(m_context->colorManager()->getPalette());
m_drawBreakPoints.changed_.connect(boost::bind(&CmsShowCommon::setDrawBreakMarkers, this));
m_gamma.changed_.connect(boost::bind(&CmsShowCommon::setGamma, this));
m_drawBreakPoints.changed_.connect(std::bind(&CmsShowCommon::setDrawBreakMarkers, this));
m_gamma.changed_.connect(std::bind(&CmsShowCommon::setGamma, this));

m_lightColorSet.StdLightBackground();
m_darkColorSet.StdDarkBackground();
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/src/CmsShowCommonPopup.cc
Expand Up @@ -27,7 +27,7 @@
#include "Fireworks/Core/interface/FWEventItemsManager.h"
#include "Fireworks/Core/interface/FWEventItem.h"

#include <boost/bind.hpp>
#include <functional>

CmsShowCommonPopup::CmsShowCommonPopup(CmsShowCommon* model, const TGWindow* p, UInt_t w, UInt_t h)
: TGTransientFrame(gClient->GetDefaultRoot(), p, w, h),
Expand Down Expand Up @@ -112,7 +112,7 @@ CmsShowCommonPopup::CmsShowCommonPopup(CmsShowCommon* model, const TGWindow* p,
// printf("QWE %d %s\n", i, ((TGFrameElement*)f->GetList()->At(i))->fFrame->ClassName());
// m_combo = static_cast<TGComboBox*>(f->GetList()->At(1));
m_combo = static_cast<TGComboBox*>(static_cast<TGFrameElement*>(f->GetList()->At(0))->fFrame);
m_common->m_palette.changed_.connect(boost::bind(&CmsShowCommonPopup::setPaletteGUI, this));
m_common->m_palette.changed_.connect(std::bind(&CmsShowCommonPopup::setPaletteGUI, this));

TGCompositeFrame* hf = new TGHorizontalFrame(vf2);
vf2->AddFrame(hf, new TGLayoutHints(kLHintsExpandX));
Expand Down
10 changes: 5 additions & 5 deletions Fireworks/Core/src/CmsShowEDI.cc
Expand Up @@ -14,7 +14,7 @@
#include <iostream>
#include <sstream>
#include <sigc++/sigc++.h>
#include <boost/bind.hpp>
#include <functional>
#include "TClass.h"
#include "TGFrame.h"
#include "TGTab.h"
Expand Down Expand Up @@ -70,7 +70,7 @@ CmsShowEDI::CmsShowEDI(const TGWindow* p, UInt_t w, UInt_t h, FWSelectionManager
m_selectionManager = selMgr;
SetCleanup(kDeepCleanup);

m_selectionManager->itemSelectionChanged_.connect(boost::bind(&CmsShowEDI::fillEDIFrame, this));
m_selectionManager->itemSelectionChanged_.connect(std::bind(&CmsShowEDI::fillEDIFrame, this));

TGVerticalFrame* vf = new TGVerticalFrame(this);
AddFrame(vf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
Expand Down Expand Up @@ -292,10 +292,10 @@ void CmsShowEDI::fillEDIFrame() {
updateLayerControls();
m_layerEntry->SetState(kTRUE);
m_displayChangedConn =
m_item->defaultDisplayPropertiesChanged_.connect(boost::bind(&CmsShowEDI::updateDisplay, this));
m_modelChangedConn = m_item->changed_.connect(boost::bind(&CmsShowEDI::updateFilter, this));
m_item->defaultDisplayPropertiesChanged_.connect(std::bind(&CmsShowEDI::updateDisplay, this));
m_modelChangedConn = m_item->changed_.connect(std::bind(&CmsShowEDI::updateFilter, this));
// m_selectionChangedConn = m_selectionManager->selectionChanged_.connect(boost::bind(&CmsShowEDI::updateSelection, this));
m_destroyedConn = m_item->goingToBeDestroyed_.connect(boost::bind(&CmsShowEDI::disconnectAll, this));
m_destroyedConn = m_item->goingToBeDestroyed_.connect(std::bind(&CmsShowEDI::disconnectAll, this));

clearPBFrame();
m_item->getConfig()->populateFrame(m_settersFrame);
Expand Down
37 changes: 20 additions & 17 deletions Fireworks/Core/src/CmsShowMain.cc
Expand Up @@ -12,7 +12,7 @@

// system include files
#include <sstream>
#include <boost/bind.hpp>
#include <functional>
#include <boost/program_options.hpp>
#include <cstring>

Expand Down Expand Up @@ -352,18 +352,18 @@ CmsShowMain::CmsShowMain(int argc, char* argv[])
CmsShowTaskExecutor::TaskFunctor f;
// first check if port is not occupied
if (vm.count(kPortCommandOpt)) {
f = boost::bind(&CmsShowMain::setupSocket, this, vm[kPortCommandOpt].as<unsigned int>());
f = std::bind(&CmsShowMain::setupSocket, this, vm[kPortCommandOpt].as<unsigned int>());
startupTasks()->addTask(f);
}
if (!geometryFilename().empty()) {
f = boost::bind(&CmsShowMainBase::loadGeometry, this);
f = std::bind(&CmsShowMainBase::loadGeometry, this);
startupTasks()->addTask(f);
}
f = boost::bind(&CmsShowMainBase::setupViewManagers, this);
f = std::bind(&CmsShowMainBase::setupViewManagers, this);
startupTasks()->addTask(f);

if (vm.count(kLiveCommandOpt)) {
f = boost::bind(&CmsShowMain::setLiveMode, this);
f = std::bind(&CmsShowMain::setLiveMode, this);
startupTasks()->addTask(f);
}

Expand All @@ -372,23 +372,23 @@ CmsShowMain::CmsShowMain(int argc, char* argv[])
m_context->getField()->setUserField(vm[kFieldCommandOpt].as<double>());
}

f = boost::bind(&CmsShowMain::setupDataHandling, this);
f = std::bind(&CmsShowMain::setupDataHandling, this);
startupTasks()->addTask(f);

if (vm.count(kLoopOpt))
setPlayLoop();

if (eveMode) {
f = boost::bind(&CmsShowMainBase::setupDebugSupport, this);
f = std::bind(&CmsShowMainBase::setupDebugSupport, this);
startupTasks()->addTask(f);
}
if (vm.count(kChainCommandOpt)) {
f = boost::bind(
f = std::bind(
&CmsShowNavigator::setMaxNumberOfFilesToChain, m_navigator.get(), vm[kChainCommandOpt].as<unsigned int>());
startupTasks()->addTask(f);
}
if (vm.count(kPlayOpt)) {
f = boost::bind(&CmsShowMainBase::setupAutoLoad, this, vm[kPlayOpt].as<float>());
f = std::bind(&CmsShowMainBase::setupAutoLoad, this, vm[kPlayOpt].as<float>());
startupTasks()->addTask(f);
}

Expand Down Expand Up @@ -420,7 +420,7 @@ CmsShowMain::CmsShowMain(int argc, char* argv[])
}

if (vm.count(kPortCommandOpt)) {
f = boost::bind(&CmsShowMain::connectSocket, this);
f = std::bind(&CmsShowMain::connectSocket, this);
startupTasks()->addTask(f);
}

Expand Down Expand Up @@ -644,14 +644,17 @@ void CmsShowMain::setupDataHandling() {
guiManager()->updateStatus("Setting up data handling...");

// navigator filtering ->
m_navigator->fileChanged_.connect(boost::bind(&CmsShowMain::fileChangedSlot, this, _1));
m_navigator->editFiltersExternally_.connect(boost::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), _1));
m_navigator->filterStateChanged_.connect(boost::bind(&CmsShowMain::navigatorChangedFilterState, this, _1));
m_navigator->postFiltering_.connect(boost::bind(&CmsShowMain::postFiltering, this, _1));
m_navigator->fileChanged_.connect(std::bind(&CmsShowMain::fileChangedSlot, this, std::placeholders::_1));
m_navigator->editFiltersExternally_.connect(
std::bind(&FWGUIManager::updateEventFilterEnable, guiManager(), std::placeholders::_1));
m_navigator->filterStateChanged_.connect(
std::bind(&CmsShowMain::navigatorChangedFilterState, this, std::placeholders::_1));
m_navigator->postFiltering_.connect(std::bind(&CmsShowMain::postFiltering, this, std::placeholders::_1));

// navigator fitlering <-
guiManager()->showEventFilterGUI_.connect(boost::bind(&CmsShowNavigator::showEventFilterGUI, m_navigator.get(), _1));
guiManager()->filterButtonClicked_.connect(boost::bind(&CmsShowMain::filterButtonClicked, this));
guiManager()->showEventFilterGUI_.connect(
std::bind(&CmsShowNavigator::showEventFilterGUI, m_navigator.get(), std::placeholders::_1));
guiManager()->filterButtonClicked_.connect(std::bind(&CmsShowMain::filterButtonClicked, this));

// Data handling. File related and therefore not in the base class.
if (guiManager()->getAction(cmsshow::sOpenData) != nullptr)
Expand Down Expand Up @@ -833,7 +836,7 @@ void CmsShowMain::postFiltering(bool doDraw) {
void CmsShowMain::setLiveMode() {
m_live = true;
m_liveTimer.reset(new SignalTimer());
m_liveTimer->timeout_.connect(boost::bind(&CmsShowMain::checkLiveMode, this));
m_liveTimer->timeout_.connect(std::bind(&CmsShowMain::checkLiveMode, this));

Window_t rootw, childw;
Int_t root_x, root_y, win_x, win_y;
Expand Down
32 changes: 19 additions & 13 deletions Fireworks/Core/src/CmsShowMainBase.cc
Expand Up @@ -5,7 +5,7 @@
#include <arpa/inet.h>
#include <netdb.h>

#include <boost/bind.hpp>
#include <functional>

#include "TGLWidget.h"
#include "TGMsgBox.h"
Expand Down Expand Up @@ -77,7 +77,7 @@ void CmsShowMainBase::setupActions() {
// init TGSlider state before signals are connected
m_guiManager->setDelayBetweenEvents(m_playDelay);

m_navigatorPtr->newEvent_.connect(boost::bind(&CmsShowMainBase::eventChangedSlot, this));
m_navigatorPtr->newEvent_.connect(std::bind(&CmsShowMainBase::eventChangedSlot, this));
if (m_guiManager->getAction(cmsshow::sNextEvent) != nullptr)
m_guiManager->getAction(cmsshow::sNextEvent)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::doNextEvent));
if (m_guiManager->getAction(cmsshow::sPreviousEvent) != nullptr)
Expand All @@ -92,16 +92,18 @@ void CmsShowMainBase::setupActions() {
if (m_guiManager->getAction(cmsshow::sQuit) != nullptr)
m_guiManager->getAction(cmsshow::sQuit)->activated.connect(sigc::mem_fun(*this, &CmsShowMainBase::quit));

m_guiManager->changedEventId_.connect(boost::bind(&CmsShowMainBase::goToRunEvent, this, _1, _2, _3));
m_guiManager->changedEventId_.connect(std::bind(
&CmsShowMainBase::goToRunEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
m_guiManager->playEventsAction()->started_.connect(sigc::mem_fun(*this, &CmsShowMainBase::playForward));
m_guiManager->playEventsBackwardsAction()->started_.connect(sigc::mem_fun(*this, &CmsShowMainBase::playBackward));
m_guiManager->loopAction()->started_.connect(sigc::mem_fun(*this, &CmsShowMainBase::setPlayLoopImp));
m_guiManager->loopAction()->stopped_.connect(sigc::mem_fun(*this, &CmsShowMainBase::unsetPlayLoopImp));
m_guiManager->changedDelayBetweenEvents_.connect(boost::bind(&CmsShowMainBase::setPlayDelay, this, _1));
m_guiManager->changedDelayBetweenEvents_.connect(
std::bind(&CmsShowMainBase::setPlayDelay, this, std::placeholders::_1));
m_guiManager->playEventsAction()->stopped_.connect(sigc::mem_fun(*this, &CmsShowMainBase::stopPlaying));
m_guiManager->playEventsBackwardsAction()->stopped_.connect(sigc::mem_fun(*this, &CmsShowMainBase::stopPlaying));

m_autoLoadTimer->timeout_.connect(boost::bind(&CmsShowMainBase::autoLoadNewEvent, this));
m_autoLoadTimer->timeout_.connect(std::bind(&CmsShowMainBase::autoLoadNewEvent, this));
}

void CmsShowMainBase::setupViewManagers() {
Expand All @@ -114,7 +116,7 @@ void CmsShowMainBase::setupViewManagers() {
auto tableViewManager = std::make_shared<FWTableViewManager>(guiManager());
configurationManager()->add(std::string("Tables"), tableViewManager.get());
viewManager()->add(tableViewManager);
eiManager()->goingToClearItems_.connect(boost::bind(&FWTableViewManager::removeAllItems, tableViewManager.get()));
eiManager()->goingToClearItems_.connect(std::bind(&FWTableViewManager::removeAllItems, tableViewManager.get()));

auto triggerTableViewManager = std::make_shared<FWTriggerTableViewManager>(guiManager());
configurationManager()->add(std::string("TriggerTables"), triggerTableViewManager.get());
Expand Down Expand Up @@ -205,23 +207,27 @@ void CmsShowMainBase::setup(FWNavigatorBase *navigator,
m_contextPtr->initEveElements();
m_guiManager.reset(new FWGUIManager(m_contextPtr, m_viewManager.get(), m_navigatorPtr));

m_eiManager->newItem_.connect(boost::bind(&FWModelChangeManager::newItemSlot, m_changeManager.get(), _1));
m_eiManager->newItem_.connect(
std::bind(&FWModelChangeManager::newItemSlot, m_changeManager.get(), std::placeholders::_1));

m_eiManager->newItem_.connect(boost::bind(&FWViewManagerManager::registerEventItem, m_viewManager.get(), _1));
m_eiManager->newItem_.connect(
std::bind(&FWViewManagerManager::registerEventItem, m_viewManager.get(), std::placeholders::_1));
m_configurationManager->add("EventItems", m_eiManager.get());
m_configurationManager->add("GUI", m_guiManager.get());
m_configurationManager->add("EventNavigator", m_navigatorPtr);
m_configurationManager->add("CommonPreferences",
m_contextPtr->commonPrefs()); // must be after GUIManager in alphabetical order

m_guiManager->writeToConfigurationFile_.connect(boost::bind(&CmsShowMainBase::writeToConfigFile, this, _1));
m_guiManager->writeToConfigurationFile_.connect(
std::bind(&CmsShowMainBase::writeToConfigFile, this, std::placeholders::_1));

m_guiManager->loadFromConfigurationFile_.connect(boost::bind(&CmsShowMainBase::reloadConfiguration, this, _1));
m_guiManager->loadFromConfigurationFile_.connect(
std::bind(&CmsShowMainBase::reloadConfiguration, this, std::placeholders::_1));
m_guiManager->loadPartialFromConfigurationFile_.connect(
boost::bind(&CmsShowMainBase::partialLoadConfiguration, this, _1));
std::bind(&CmsShowMainBase::partialLoadConfiguration, this, std::placeholders::_1));

m_guiManager->writePartialToConfigurationFile_.connect(
boost::bind(&CmsShowMainBase::partialWriteToConfigFile, this, _1));
std::bind(&CmsShowMainBase::partialWriteToConfigFile, this, std::placeholders::_1));

std::string macPath(gSystem->Getenv("CMSSW_BASE"));
macPath += "/src/Fireworks/Core/macros";
Expand All @@ -233,7 +239,7 @@ void CmsShowMainBase::setup(FWNavigatorBase *navigator,
}
gROOT->SetMacroPath((std::string("./:") + macPath).c_str());

m_startupTasks->tasksCompleted_.connect(boost::bind(&FWGUIManager::clearStatus, m_guiManager.get()));
m_startupTasks->tasksCompleted_.connect(std::bind(&FWGUIManager::clearStatus, m_guiManager.get()));
}

void CmsShowMainBase::writeToConfigFile(const std::string &name) {
Expand Down
9 changes: 5 additions & 4 deletions Fireworks/Core/src/CmsShowModelPopup.cc
Expand Up @@ -16,7 +16,7 @@
#include <set>
#include <cassert>
#include <sigc++/sigc++.h>
#include <boost/bind.hpp>
#include <functional>
#include "TClass.h"
#include "TGFrame.h"
#include "TGButton.h"
Expand Down Expand Up @@ -61,7 +61,8 @@ CmsShowModelPopup::CmsShowModelPopup(FWDetailViewManager *iManager,
m_detailViewManager(iManager),
m_colorManager(iColorMgr),
m_dialogBuilder(nullptr) {
m_changes = iSelMgr->selectionChanged_.connect(boost::bind(&CmsShowModelPopup::fillModelPopup, this, _1));
m_changes =
iSelMgr->selectionChanged_.connect(std::bind(&CmsShowModelPopup::fillModelPopup, this, std::placeholders::_1));

SetCleanup(kDeepCleanup);

Expand Down Expand Up @@ -223,8 +224,8 @@ void CmsShowModelPopup::fillModelPopup(const FWSelectionManager &iSelMgr) {
m_colorSelectWidget->SetEnabled(kTRUE);
m_isVisibleButton->SetEnabled(kTRUE);

m_modelChangedConn = item->changed_.connect(boost::bind(&CmsShowModelPopup::updateDisplay, this));
m_destroyedConn = item->goingToBeDestroyed_.connect(boost::bind(&CmsShowModelPopup::disconnectAll, this));
m_modelChangedConn = item->changed_.connect(std::bind(&CmsShowModelPopup::updateDisplay, this));
m_destroyedConn = item->goingToBeDestroyed_.connect(std::bind(&CmsShowModelPopup::disconnectAll, this));

Resize(GetDefaultSize());
Layout();
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/src/CmsShowNavigator.cc
Expand Up @@ -10,7 +10,7 @@
#include "Fireworks/Core/interface/FWEventItem.h"

// system include files
#include "boost/bind.hpp"
#include <functional>
#include "boost/regex.hpp"
#include "TROOT.h"
#include "TTree.h"
Expand Down Expand Up @@ -58,7 +58,7 @@ CmsShowNavigator::CmsShowNavigator(const CmsShowMain& main)
m_main(main),
m_guiFilter(nullptr) {
m_guiFilter = new FWGUIEventFilter(this);
filterStateChanged_.connect(boost::bind(&FWGUIEventFilter::updateFilterStateLabel, m_guiFilter, _1));
filterStateChanged_.connect(std::bind(&FWGUIEventFilter::updateFilterStateLabel, m_guiFilter, std::placeholders::_1));
}

CmsShowNavigator::~CmsShowNavigator() { delete m_guiFilter; }
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/src/CmsShowViewPopup.cc
Expand Up @@ -12,7 +12,7 @@

// system include files
#include <iostream>
#include <boost/bind.hpp>
#include <functional>
#include <cassert>
#include "TGLabel.h"
#include "TGButton.h"
Expand Down Expand Up @@ -51,7 +51,7 @@ CmsShowViewPopup::CmsShowViewPopup(
m_colorManager(iCMgr),
m_viewBase(nullptr),
m_eveWindow(nullptr) {
m_colorManager->colorsHaveChanged_.connect(boost::bind(&CmsShowViewPopup::backgroundColorWasChanged, this));
m_colorManager->colorsHaveChanged_.connect(std::bind(&CmsShowViewPopup::backgroundColorWasChanged, this));

SetCleanup(kDeepCleanup);

Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/src/Context.cc
Expand Up @@ -24,7 +24,7 @@
#include "Fireworks/Core/interface/FWBeamSpot.h"
#include "Fireworks/Core/interface/CmsShowCommon.h"

#include <boost/bind.hpp>
#include <functional>

using namespace fireworks;

Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/src/FW3DView.cc
Expand Up @@ -11,7 +11,7 @@
//

// system include files
#include <boost/bind.hpp>
#include <functional>

// user include files
#include "TGLViewer.h"
Expand Down

0 comments on commit 75a1f51

Please sign in to comment.