Skip to content

Commit

Permalink
Merge pull request #1 from Purva-Chaudhari/bindBranch
Browse files Browse the repository at this point in the history
Remove boost::bind dependency
  • Loading branch information
Purva-Chaudhari committed Jul 4, 2021
2 parents a5d8d81 + 205ef8d commit b8bec15
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 28 deletions.
5 changes: 2 additions & 3 deletions CondCore/CondDB/plugins/RelationalAuthenticationService.cc
Expand Up @@ -16,17 +16,16 @@
#include <memory>
#include <sys/stat.h>

#include <boost/bind/bind.hpp>

#include "CoralBase/MessageStream.h"

cond::RelationalAuthenticationService::RelationalAuthenticationService::RelationalAuthenticationService(
const std::string& key)
: coral::Service(key), m_authenticationPath(""), m_db(), m_cache(), m_callbackID(0) {
boost::function1<void, std::string> cb(
boost::bind(&cond::RelationalAuthenticationService::RelationalAuthenticationService::setAuthenticationPath,
std::bind(&cond::RelationalAuthenticationService::RelationalAuthenticationService::setAuthenticationPath,
this,
boost::placeholders::_1));
std::placeholders::_1));

coral::Property* pm = dynamic_cast<coral::Property*>(
coral::Context::instance().PropertyManager().property(auth::COND_AUTH_PATH_PROPERTY));
Expand Down
3 changes: 1 addition & 2 deletions CondCore/CondDB/plugins/XMLAuthenticationService.cc
Expand Up @@ -24,7 +24,6 @@
#include <memory>
#include <sys/stat.h>

#include <boost/bind.hpp>
#include "CoralBase/MessageStream.h"

constexpr char XML_AUTHENTICATION_FILE[] = "authentication.xml";
Expand Down Expand Up @@ -78,7 +77,7 @@ const coral::IAuthenticationCredentials& cond::XMLAuthenticationService::DataSou
cond::XMLAuthenticationService::XMLAuthenticationService::XMLAuthenticationService(const std::string& key)
: coral::Service(key), m_isInitialized(false), m_inputFileName(""), m_data(), m_mutexLock(), m_callbackID(0) {
boost::function1<void, std::string> cb(
boost::bind(&cond::XMLAuthenticationService::XMLAuthenticationService::setAuthenticationPath, this, _1));
std::bind(&cond::XMLAuthenticationService::XMLAuthenticationService::setAuthenticationPath, this, std::placeholders::_1));

coral::Property* pm = dynamic_cast<coral::Property*>(
coral::Context::instance().PropertyManager().property(auth::COND_AUTH_PATH_PROPERTY));
Expand Down
2 changes: 1 addition & 1 deletion CondCore/Utilities/src/CondDBTools.cc
Expand Up @@ -5,7 +5,7 @@
#include "CondCore/CondDB/src/DbCore.h"
//
#include <boost/regex.hpp>
#include <boost/bind.hpp>

#include <memory>

namespace cond {
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/EcalDigi/test/EcalDigi_t.cpp
Expand Up @@ -173,7 +173,7 @@ namespace {
}

// std::for_each(frames.begin(),frames.end(),
// boost::bind(verifyId,boost::bind(&edm::DataFrame::id,_1)));
// std::bind(verifyId,std::bind(&edm::DataFrame::id, std::placeholders::_1)));
// same as above....
for (int n = 0; n < int(frames.size()); ++n) {
edm::DataFrame df = frames[n];
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/src/FWCompositeParameter.cc
Expand Up @@ -78,7 +78,7 @@ void FWCompositeParameter::addTo(FWConfiguration& oTo) const {
(*it)->addTo(conf);
}
// std::for_each(begin(), end(),
// boost::bind(&FWParameterBase::addTo,_1,conf));
// std::bind(&FWParameterBase::addTo, std::placeholders::_1,conf));

oTo.addKeyValue(name(), conf, true);
}
Expand Down
1 change: 0 additions & 1 deletion Fireworks/Core/src/FWISpyView.cc
Expand Up @@ -11,7 +11,6 @@
//

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

// user include files
#include "TGLViewer.h"
Expand Down
5 changes: 2 additions & 3 deletions Fireworks/Core/test/unittest_changemanager.cc
Expand Up @@ -12,7 +12,6 @@

// system include files
#include <boost/test/auto_unit_test.hpp>
#include <boost/bind.hpp>
#include <boost/test/test_tools.hpp>

#include "TClass.h"
Expand Down Expand Up @@ -96,8 +95,8 @@ BOOST_AUTO_TEST_CASE(changemanager) {
//NOTE: have to pass a pointer to the listener else the bind will
// create a copy of the listener and the original one will never
// 'hear' any signal
item.changed_.connect(boost::bind(&Listener::listen, &listener, _1));
item.itemChanged_.connect(boost::bind(&ItemListener::listen, &iListener, _1));
item.changed_.connect(std::bind(&Listener::listen, &listener, std::placeholders::_1));
item.itemChanged_.connect(std::bind(&ItemListener::listen, &iListener, std::placeholders::_1));

BOOST_CHECK(listener.nHeard_ == 0);
BOOST_CHECK(iListener.nHeard_ == 0);
Expand Down
3 changes: 1 addition & 2 deletions Fireworks/Core/test/unittest_eventitemsmanager.cc
Expand Up @@ -12,7 +12,6 @@

// system include files
#include <boost/test/auto_unit_test.hpp>
#include <boost/bind.hpp>
#include <boost/test/test_tools.hpp>
#include "TClass.h"

Expand Down Expand Up @@ -62,7 +61,7 @@ BOOST_AUTO_TEST_CASE(eventitemmanager) {
//NOTE: have to pass a pointer to the listener else the bind will
// create a copy of the listener and the original one will never
// 'hear' any signal
eim.newItem_.connect(boost::bind(&Listener::newItem, &listener, _1));
eim.newItem_.connect(std::bind(&Listener::newItem, &listener, std::placeholders::_1));

TClass* cls = TClass::GetClass("std::vector<reco::Track>");
assert(0 != cls);
Expand Down
5 changes: 2 additions & 3 deletions Fireworks/Core/test/unittest_parameters.cc
Expand Up @@ -13,7 +13,6 @@
// system include files
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/bind.hpp>
#include <stdexcept>
#include <iostream>

Expand All @@ -26,8 +25,8 @@
namespace {
struct Test : public FWParameterizable {
Test()
: m_double(this, "double", boost::bind(&Test::doubleChanged, this, _1)),
m_long(this, "long", boost::bind(&Test::longChanged, this, _1)),
: m_double(this, "double", std::bind(&Test::doubleChanged, this, std::placeholders::_1)),
m_long(this, "long", std::bind(&Test::longChanged, this, std::placeholders::_1)),
m_wasChanged(false) {}

void doubleChanged(double iValue) {
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/test/unittest_selectionmanager.cc
Expand Up @@ -12,7 +12,7 @@

// system include files
//#include <boost/test/auto_unit_test.hpp>
#include <boost/bind.hpp>

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
Expand Down Expand Up @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(selectionmanager) {
//NOTE: have to pass a pointer to the listener else the bind will
// create a copy of the listener and the original one will never
// 'hear' any signal
sm.selectionChanged_.connect(boost::bind(&Listener::listen, &listener, _1));
sm.selectionChanged_.connect(std::bind(&Listener::listen, &listener, std::placeholders::_1));

reco::TrackCollection fVector;
fVector.push_back(reco::Track());
Expand Down
5 changes: 2 additions & 3 deletions GeneratorInterface/LHEInterface/plugins/LH5Source.cc
Expand Up @@ -4,7 +4,6 @@
#include <string>
#include <memory>

#include <boost/bind.hpp>

#include "FWCore/Framework/interface/InputSourceMacros.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -148,13 +147,13 @@ void LH5Source::readEvent_(edm::EventPrincipal& eventPrincipal) {
}
std::for_each(partonLevel_->weights().begin(),
partonLevel_->weights().end(),
boost::bind(&LHEEventProduct::addWeight, product.get(), _1));
std::bind(&LHEEventProduct::addWeight, product.get(), std::placeholders::_1));
product->setScales(partonLevel_->scales());
product->setNpLO(partonLevel_->npLO());
product->setNpNLO(partonLevel_->npNLO());
std::for_each(partonLevel_->getComments().begin(),
partonLevel_->getComments().end(),
boost::bind(&LHEEventProduct::addComment, product.get(), _1));
std::bind(&LHEEventProduct::addComment, product.get(), std::placeholders::_1));

std::unique_ptr<edm::WrapperBase> edp(new edm::Wrapper<LHEEventProduct>(std::move(product)));
eventPrincipal.put(lheProvenanceHelper_.eventProductBranchDescription_,
Expand Down
Expand Up @@ -7,7 +7,6 @@
#include <sstream>
#include <string>

#include <boost/bind.hpp>

#include "FWCore/Framework/interface/InputSourceMacros.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down
2 changes: 1 addition & 1 deletion GeneratorInterface/Pythia6Interface/src/Pythia6Service.cc
Expand Up @@ -7,7 +7,7 @@
#include <string>
#include <set>

#include <boost/bind.hpp>

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <filesystem>
Expand Down
2 changes: 1 addition & 1 deletion PerfTools/Callgrind/test/ProfilerServiceTest.cppunit.cc
Expand Up @@ -4,7 +4,7 @@
#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"

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


#include <limits>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion RecoLocalTracker/SiPixelRecHits/src/VVIObj.cc
Expand Up @@ -20,7 +20,7 @@

#include <cmath>
#include <algorithm>
#include <boost/bind.hpp>


namespace VVIObjDetails {
void sincosint(double x, double& sint, double& cint); //! Private version of the cosine and sine integral
Expand Down
1 change: 0 additions & 1 deletion SimMuon/CSCDigitizer/src/CSCStripElectronicsSim.cc
Expand Up @@ -14,7 +14,6 @@
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"

#include "boost/bind.hpp"
#include <cassert>
#include <list>

Expand Down
1 change: 0 additions & 1 deletion Validation/MuonRPCGeometry/test/RPCHistos.cc
Expand Up @@ -11,7 +11,6 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "L1Trigger/RPCTrigger/interface/RPCConst.h"
#include "FWCore/Utilities/interface/Exception.h"
//#include "boost/bind.hpp"

const double ptRanges[RPCConst::m_PT_CODE_MAX+2]= {
0.0, 0.01,
Expand Down

0 comments on commit b8bec15

Please sign in to comment.