Skip to content

Commit

Permalink
Merge pull request #31777 from Dr15Jones/code-checks-FWCore
Browse files Browse the repository at this point in the history
Fix code-checks errors in FWCore and DataFormats/Common
  • Loading branch information
cmsbuild authored Oct 14, 2020
2 parents a623ea8 + 83336a0 commit e4dbd1b
Show file tree
Hide file tree
Showing 36 changed files with 102 additions and 165 deletions.
7 changes: 2 additions & 5 deletions DataFormats/Common/interface/Wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ namespace edm {
typedef T wrapped_type; // used with the dictionary to identify Wrappers
Wrapper() : WrapperBase(), present(false), obj() {}
explicit Wrapper(std::unique_ptr<T> ptr);
Wrapper(Wrapper<T> const& rh) = delete; // disallow copy construction
Wrapper<T>& operator=(Wrapper<T> const&) = delete; // disallow assignment

template <typename... Args>
explicit Wrapper(Emplace, Args&&...);
Expand Down Expand Up @@ -71,11 +73,6 @@ namespace edm {
std::shared_ptr<soa::TableExaminerBase> tableExaminer_() const override;

private:
// We wish to disallow copy construction and assignment.
// We make the copy constructor and assignment operator private.
Wrapper(Wrapper<T> const& rh) = delete; // disallow copy construction
Wrapper<T>& operator=(Wrapper<T> const&) = delete; // disallow assignment

bool present;
T obj;
};
Expand Down
5 changes: 2 additions & 3 deletions FWCore/Concurrency/interface/LimitedTaskQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace edm {
class LimitedTaskQueue {
public:
LimitedTaskQueue(unsigned int iLimit) : m_queues{iLimit} {}
LimitedTaskQueue(const LimitedTaskQueue&) = delete;
const LimitedTaskQueue& operator=(const LimitedTaskQueue&) = delete;

// ---------- member functions ---------------------------

Expand Down Expand Up @@ -116,9 +118,6 @@ namespace edm {
unsigned int concurrencyLimit() const { return m_queues.size(); }

private:
LimitedTaskQueue(const LimitedTaskQueue&) = delete;
const LimitedTaskQueue& operator=(const LimitedTaskQueue&) = delete;

// ---------- member data --------------------------------
std::vector<SerialTaskQueue> m_queues;
};
Expand Down
6 changes: 3 additions & 3 deletions FWCore/Concurrency/interface/SerialTaskQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ namespace edm {
m_pauseCount(iOther.m_pauseCount.exchange(0)) {
assert(m_tasks.empty() and m_taskChosen == false);
}
SerialTaskQueue(const SerialTaskQueue&) = delete;
const SerialTaskQueue& operator=(const SerialTaskQueue&) = delete;

~SerialTaskQueue();

// ---------- const member functions ---------------------
Expand Down Expand Up @@ -139,9 +142,6 @@ namespace edm {
tbb::task* pushAndGetNextTaskToRun(const T& iAction);

private:
SerialTaskQueue(const SerialTaskQueue&) = delete;
const SerialTaskQueue& operator=(const SerialTaskQueue&) = delete;

/** Base class for all tasks held by the SerialTaskQueue */
class TaskBase : public tbb::task {
friend class SerialTaskQueue;
Expand Down
5 changes: 2 additions & 3 deletions FWCore/Concurrency/interface/WaitingTaskList.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ namespace edm {
* The value is only useful for optimization as the object can resize itself.
*/
explicit WaitingTaskList(unsigned int iInitialSize = 2);
WaitingTaskList(const WaitingTaskList&) = delete; // stop default
const WaitingTaskList& operator=(const WaitingTaskList&) = delete; // stop default
~WaitingTaskList() = default;

// ---------- member functions ---------------------------
Expand Down Expand Up @@ -143,9 +145,6 @@ namespace edm {
void reset();

private:
WaitingTaskList(const WaitingTaskList&) = delete; // stop default
const WaitingTaskList& operator=(const WaitingTaskList&) = delete; // stop default

/**Handles spawning the tasks,
* safe to call from multiple threads
*/
Expand Down
7 changes: 2 additions & 5 deletions FWCore/Framework/interface/ComponentMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ namespace edm {
class ComponentMaker : public ComponentMakerBase<T> {
public:
ComponentMaker() {}
//virtual ~ComponentMaker();
ComponentMaker(const ComponentMaker&) = delete; // stop default
const ComponentMaker& operator=(const ComponentMaker&) = delete; // stop default
typedef typename T::base_type base_type;

// ---------- const member functions ---------------------
Expand All @@ -70,10 +71,6 @@ namespace edm {

// ---------- member functions ---------------------------
private:
ComponentMaker(const ComponentMaker&) = delete; // stop default

const ComponentMaker& operator=(const ComponentMaker&) = delete; // stop default

void setDescription(DataProxyProvider* iProv, const ComponentDescription& iDesc) const {
iProv->setDescription(iDesc);
}
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/ModuleChanger.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace edm {
class ModuleChanger {
public:
ModuleChanger(Schedule*, ProductRegistry const* iReg, eventsetup::ESRecordsToProxyIndices);
ModuleChanger(const ModuleChanger&) = delete; // stop default
const ModuleChanger& operator=(const ModuleChanger&) = delete; // stop default
virtual ~ModuleChanger();

// ---------- const member functions ---------------------
Expand All @@ -46,10 +48,6 @@ namespace edm {
bool changeModule(const std::string& iLabel, const ParameterSet& iPSet);

private:
ModuleChanger(const ModuleChanger&) = delete; // stop default

const ModuleChanger& operator=(const ModuleChanger&) = delete; // stop default

// ---------- member data --------------------------------
edm::propagate_const<Schedule*> schedule_;
ProductRegistry const* registry_;
Expand Down
7 changes: 2 additions & 5 deletions FWCore/Framework/interface/ProcessingController.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ namespace edm {
};

ProcessingController(ForwardState forwardState, ReverseState reverseState, bool iCanRandomAccess);
//virtual ~ProcessingController();
ProcessingController(const ProcessingController&) = delete; // stop default
const ProcessingController& operator=(const ProcessingController&) = delete; // stop default

// ---------- const member functions ---------------------

Expand Down Expand Up @@ -86,10 +87,6 @@ namespace edm {
void setLastOperationSucceeded(bool value);

private:
ProcessingController(const ProcessingController&) = delete; // stop default

const ProcessingController& operator=(const ProcessingController&) = delete; // stop default

// ---------- member data --------------------------------
ForwardState forwardState_;
ReverseState reverseState_;
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ namespace edm {
typename T::GlobalCache const* dummy = nullptr;
m_global = impl::makeGlobal<T>(iPSet, dummy);
}
EDAnalyzerAdaptor(const EDAnalyzerAdaptor&) = delete; // stop default
const EDAnalyzerAdaptor& operator=(const EDAnalyzerAdaptor&) = delete; // stop default
~EDAnalyzerAdaptor() override {}

static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); }
Expand Down Expand Up @@ -211,10 +213,6 @@ namespace edm {
}
}

EDAnalyzerAdaptor(const EDAnalyzerAdaptor&) = delete; // stop default

const EDAnalyzerAdaptor& operator=(const EDAnalyzerAdaptor&) = delete; // stop default

// ---------- member data --------------------------------
typename impl::choose_unique_ptr<typename T::GlobalCache>::type m_global;
typename impl::choose_shared_vec<typename T::RunCache const>::type m_runs;
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ namespace edm {
friend class edm::maker::ModuleHolderT;

EDAnalyzerAdaptorBase();
EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default
const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default
virtual ~EDAnalyzerAdaptorBase();

// ---------- const member functions ---------------------
Expand Down Expand Up @@ -119,10 +121,6 @@ namespace edm {
std::vector<ConsumesInfo> consumesInfo() const;

private:
EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default

const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default

bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);
void doPreallocate(PreallocationConfiguration const&);
virtual void preallocLumis(unsigned int) {}
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDAnalyzerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ namespace edm {
typedef EDAnalyzerAdaptorBase ModuleType;

EDAnalyzerBase();
EDAnalyzerBase(const EDAnalyzerBase&) = delete; // stop default
const EDAnalyzerBase& operator=(const EDAnalyzerBase&) = delete; // stop default
~EDAnalyzerBase() override;

static void fillDescriptions(ConfigurationDescriptions& descriptions);
Expand All @@ -52,10 +54,6 @@ namespace edm {
void callWhenNewProductsRegistered(std::function<void(BranchDescription const&)> const& func);

private:
EDAnalyzerBase(const EDAnalyzerBase&) = delete; // stop default

const EDAnalyzerBase& operator=(const EDAnalyzerBase&) = delete; // stop default

void registerProductsAndCallbacks(EDAnalyzerBase const*, ProductRegistry* reg);

virtual void beginStream(StreamID) {}
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDFilterAdaptorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ namespace edm {
friend class edm::WorkerT;

EDFilterAdaptorBase();
EDFilterAdaptorBase(const EDFilterAdaptorBase&) = delete; // stop default
const EDFilterAdaptorBase& operator=(const EDFilterAdaptorBase&) = delete; // stop default

// ---------- const member functions ---------------------

Expand All @@ -66,10 +68,6 @@ namespace edm {
using ProducingModuleAdaptorBase<EDFilterBase>::commit;

private:
EDFilterAdaptorBase(const EDFilterAdaptorBase&) = delete; // stop default

const EDFilterAdaptorBase& operator=(const EDFilterAdaptorBase&) = delete; // stop default

bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);

void doAcquire(EventTransitionInfo const&,
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDFilterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ namespace edm {
typedef EDFilterAdaptorBase ModuleType;

EDFilterBase();
EDFilterBase(const EDFilterBase&) = delete; // stop default
const EDFilterBase& operator=(const EDFilterBase&) = delete; // stop default
~EDFilterBase() override;

static void fillDescriptions(ConfigurationDescriptions& descriptions);
Expand All @@ -59,10 +61,6 @@ namespace edm {
ModuleDescription const& moduleDescription() const { return *moduleDescriptionPtr_; }

private:
EDFilterBase(const EDFilterBase&) = delete; // stop default

const EDFilterBase& operator=(const EDFilterBase&) = delete; // stop default

virtual void beginStream(StreamID) {}
virtual void beginRun(edm::Run const&, edm::EventSetup const&) {}
virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {}
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDProducerAdaptorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ namespace edm {
friend class edm::WorkerT;

EDProducerAdaptorBase();
EDProducerAdaptorBase(const EDProducerAdaptorBase&) = delete; // stop default
const EDProducerAdaptorBase& operator=(const EDProducerAdaptorBase&) = delete; // stop default

// ---------- const member functions ---------------------

Expand All @@ -66,10 +68,6 @@ namespace edm {
using ProducingModuleAdaptorBase<EDProducerBase>::commit;

private:
EDProducerAdaptorBase(const EDProducerAdaptorBase&) = delete; // stop default

const EDProducerAdaptorBase& operator=(const EDProducerAdaptorBase&) = delete; // stop default

bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);

void doAcquire(EventTransitionInfo const&,
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/EDProducerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace edm {
typedef EDProducerAdaptorBase ModuleType;

EDProducerBase();
EDProducerBase(const EDProducerBase&) = delete; // stop default
const EDProducerBase& operator=(const EDProducerBase&) = delete; // stop default
~EDProducerBase() override;

static void fillDescriptions(ConfigurationDescriptions& descriptions);
Expand All @@ -60,10 +62,6 @@ namespace edm {
ModuleDescription const& moduleDescription() const { return *moduleDescriptionPtr_; }

private:
EDProducerBase(const EDProducerBase&) = delete; // stop default

const EDProducerBase& operator=(const EDProducerBase&) = delete; // stop default

virtual void beginStream(StreamID) {}
virtual void beginRun(edm::Run const&, edm::EventSetup const&) {}
virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {}
Expand Down
6 changes: 2 additions & 4 deletions FWCore/Framework/interface/stream/ProducingModuleAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace edm {
typename T::GlobalCache const* dummy = nullptr;
m_global = impl::makeGlobal<T>(iPSet, dummy);
}
ProducingModuleAdaptor(const ProducingModuleAdaptor&) = delete; // stop default
const ProducingModuleAdaptor& operator=(const ProducingModuleAdaptor&) = delete; // stop default
~ProducingModuleAdaptor() override {}

static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); }
Expand Down Expand Up @@ -249,10 +251,6 @@ namespace edm {
}
}

ProducingModuleAdaptor(const ProducingModuleAdaptor&) = delete; // stop default

const ProducingModuleAdaptor& operator=(const ProducingModuleAdaptor&) = delete; // stop default

// ---------- member data --------------------------------
typename impl::choose_unique_ptr<typename T::GlobalCache>::type m_global;
typename impl::choose_shared_vec<typename T::RunCache const>::type m_runs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ namespace edm {
friend class edm::maker::ModuleHolderT;

ProducingModuleAdaptorBase();
ProducingModuleAdaptorBase(const ProducingModuleAdaptorBase&) = delete; // stop default
const ProducingModuleAdaptorBase& operator=(const ProducingModuleAdaptorBase&) = delete; // stop default
virtual ~ProducingModuleAdaptorBase();

// ---------- const member functions ---------------------
Expand Down Expand Up @@ -142,10 +144,6 @@ namespace edm {
const ProducerBase* producer() { return m_streamModules[0]; }

private:
ProducingModuleAdaptorBase(const ProducingModuleAdaptorBase&) = delete; // stop default

const ProducingModuleAdaptorBase& operator=(const ProducingModuleAdaptorBase&) = delete; // stop default

void doPreallocate(PreallocationConfiguration const&);
virtual void preallocLumis(unsigned int) {}
virtual void setupStreamModules() = 0;
Expand Down
7 changes: 3 additions & 4 deletions FWCore/Framework/src/SharedResourcesRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ namespace edm {
//needed for testing
friend class ::testSharedResourcesRegistry;

SharedResourcesRegistry(const SharedResourcesRegistry&) = delete; // stop default
const SharedResourcesRegistry& operator=(const SharedResourcesRegistry&) = delete; // stop default

// ---------- const member functions ---------------------
SharedResourcesAcquirer createAcquirer(std::vector<std::string> const&) const;

Expand All @@ -67,10 +70,6 @@ namespace edm {
SharedResourcesRegistry();
~SharedResourcesRegistry() = default;

SharedResourcesRegistry(const SharedResourcesRegistry&) = delete; // stop default

const SharedResourcesRegistry& operator=(const SharedResourcesRegistry&) = delete; // stop default

// ---------- member data --------------------------------
std::map<std::string, std::pair<std::shared_ptr<SerialTaskQueue>, unsigned int>> resourceMap_;

Expand Down
7 changes: 3 additions & 4 deletions FWCore/Framework/src/UnscheduledConfigurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace edm {
}
}

UnscheduledConfigurator(const UnscheduledConfigurator&) = delete; // stop default
const UnscheduledConfigurator& operator=(const UnscheduledConfigurator&) = delete; // stop default

// ---------- const member functions ---------------------
Worker* findWorker(std::string const& iLabel) const {
auto itFound = m_labelToWorker.find(iLabel);
Expand All @@ -50,10 +53,6 @@ namespace edm {
UnscheduledAuxiliary const* auxiliary() const { return m_aux; }

private:
UnscheduledConfigurator(const UnscheduledConfigurator&) = delete; // stop default

const UnscheduledConfigurator& operator=(const UnscheduledConfigurator&) = delete; // stop default

// ---------- member data --------------------------------
std::unordered_map<std::string, Worker*> m_labelToWorker;
UnscheduledAuxiliary const* m_aux;
Expand Down
4 changes: 2 additions & 2 deletions FWCore/MessageLogger/interface/MessageDrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ namespace edm {
struct MessageDrop {
private:
MessageDrop(); // change log 10:
// moved to cc file

public:
MessageDrop(MessageDrop const&) = delete;
MessageDrop& operator=(MessageDrop const&) = delete;

public:
~MessageDrop(); // change log 10
static MessageDrop* instance();
std::string moduleContext();
Expand Down
Loading

0 comments on commit e4dbd1b

Please sign in to comment.