Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply code checks to the FWCore packages #29885

Merged
merged 3 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FWCore/Framework/interface/ESOutlet.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace edm {
Getter(const edm::EventSetup& iES, const std::string& iLabel = std::string()) : es_(&iES), label_(iLabel) {}

private:
virtual const T* getImpl() const {
const T* getImpl() const override {
ESHandle<T> data;
es_->template get<TRec>().get(label_, data);
return &(*data);
Expand All @@ -59,9 +59,9 @@ namespace edm {
//virtual ~ESOutlet();

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

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

// ---------- member data --------------------------------
Getter getter_;
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ namespace edm {

template <typename PROD>
OrphanHandle<PROD> Event::put(EDPutToken token, std::unique_ptr<PROD> product) {
if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
TypeID typeID(typeid(PROD));
principal_get_adapter_detail::throwOnPutOfNullProduct("Event", typeID, provRecorder_.productInstanceLabel(token));
}
Expand Down
4 changes: 2 additions & 2 deletions FWCore/Framework/interface/LuminosityBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace edm {

template <typename PROD>
void LuminosityBlock::put(EDPutTokenT<PROD> token, std::unique_ptr<PROD> product) {
if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
TypeID typeID(typeid(PROD));
principal_get_adapter_detail::throwOnPutOfNullProduct(
"LuminosityBlock", typeID, provRecorder_.productInstanceLabel(token));
Expand All @@ -226,7 +226,7 @@ namespace edm {

template <typename PROD>
void LuminosityBlock::put(EDPutToken token, std::unique_ptr<PROD> product) {
if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
TypeID typeID(typeid(PROD));
principal_get_adapter_detail::throwOnPutOfNullProduct(
"LuminosityBlock", typeID, provRecorder_.productInstanceLabel(token));
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/Run.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace edm {

template <typename PROD>
void Run::put(EDPutTokenT<PROD> token, std::unique_ptr<PROD> product) {
if (UNLIKELY(product.get() == 0)) { // null pointer is illegal
if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
TypeID typeID(typeid(PROD));
principal_get_adapter_detail::throwOnPutOfNullProduct("Run", typeID, provRecorder_.productInstanceLabel(token));
}
Expand Down
4 changes: 2 additions & 2 deletions FWCore/Framework/interface/es_impl/MayConsumeChooser.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace edm::eventsetup::impl {
return func_(this->tagGetter(), iRecord.getTransientHandle(token_));
}

virtual EventSetupRecordKey recordKey() const noexcept final { return EventSetupRecordKey::makeKey<RCD>(); }
virtual TypeTag productType() const noexcept final { return DataKey::makeTypeTag<PRODUCT>(); }
EventSetupRecordKey recordKey() const noexcept final { return EventSetupRecordKey::makeKey<RCD>(); }
TypeTag productType() const noexcept final { return DataKey::makeTypeTag<PRODUCT>(); }

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

Expand Down
6 changes: 3 additions & 3 deletions FWCore/Framework/interface/global/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace edm {
RunSummaryCacheHolder() = default;
RunSummaryCacheHolder(RunSummaryCacheHolder<T, C> const&) = delete;
RunSummaryCacheHolder<T, C>& operator=(RunSummaryCacheHolder<T, C> const&) = delete;
~RunSummaryCacheHolder() noexcept(false){};
~RunSummaryCacheHolder() noexcept(false) override{};

private:
friend class EndRunSummaryProducer<T, C>;
Expand Down Expand Up @@ -251,7 +251,7 @@ namespace edm {
EndRunSummaryProducer() = default;
EndRunSummaryProducer(EndRunSummaryProducer const&) = delete;
EndRunSummaryProducer& operator=(EndRunSummaryProducer const&) = delete;
~EndRunSummaryProducer() noexcept(false){};
~EndRunSummaryProducer() noexcept(false) override{};

private:
void doEndRunProduce_(Run& rp, EventSetup const& c) final {
Expand Down Expand Up @@ -293,7 +293,7 @@ namespace edm {
EndLuminosityBlockSummaryProducer() = default;
EndLuminosityBlockSummaryProducer(EndLuminosityBlockSummaryProducer const&) = delete;
EndLuminosityBlockSummaryProducer& operator=(EndLuminosityBlockSummaryProducer const&) = delete;
~EndLuminosityBlockSummaryProducer() noexcept(false){};
~EndLuminosityBlockSummaryProducer() noexcept(false) override{};

private:
void doEndLuminosityBlockProduce_(LuminosityBlock& lb, EventSetup const& c) final {
Expand Down
14 changes: 7 additions & 7 deletions FWCore/Framework/interface/limited/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace edm {
StreamCacheHolder(edm::ParameterSet const& iPSet) : T(iPSet) {}
StreamCacheHolder(StreamCacheHolder<T, C> const&) = delete;
StreamCacheHolder<T, C>& operator=(StreamCacheHolder<T, C> const&) = delete;
~StreamCacheHolder() {
~StreamCacheHolder() override {
for (auto c : caches_) {
delete c;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ namespace edm {
RunCacheHolder(edm::ParameterSet const& iPSet) : T(iPSet) {}
RunCacheHolder(RunCacheHolder<T, C> const&) = delete;
RunCacheHolder<T, C>& operator=(RunCacheHolder<T, C> const&) = delete;
~RunCacheHolder() noexcept(false){};
~RunCacheHolder() noexcept(false) override{};

protected:
C const* runCache(edm::RunIndex iID) const { return cache_.get(); }
Expand All @@ -117,7 +117,7 @@ namespace edm {
LuminosityBlockCacheHolder(edm::ParameterSet const& iPSet) : T(iPSet) {}
LuminosityBlockCacheHolder(LuminosityBlockCacheHolder<T, C> const&) = delete;
LuminosityBlockCacheHolder<T, C>& operator=(LuminosityBlockCacheHolder<T, C> const&) = delete;
~LuminosityBlockCacheHolder() noexcept(false){};
~LuminosityBlockCacheHolder() noexcept(false) override{};

protected:
C const* luminosityBlockCache(edm::LuminosityBlockIndex iID) const { return caches_[iID].get(); }
Expand Down Expand Up @@ -149,7 +149,7 @@ namespace edm {
RunSummaryCacheHolder(edm::ParameterSet const& iPSet) : T(iPSet) {}
RunSummaryCacheHolder(RunSummaryCacheHolder<T, C> const&) = delete;
RunSummaryCacheHolder<T, C>& operator=(RunSummaryCacheHolder<T, C> const&) = delete;
~RunSummaryCacheHolder() noexcept(false){};
~RunSummaryCacheHolder() noexcept(false) override{};

private:
friend class EndRunSummaryProducer<T, C>;
Expand Down Expand Up @@ -182,7 +182,7 @@ namespace edm {
LuminosityBlockSummaryCacheHolder(edm::ParameterSet const& iPSet) : T(iPSet) {}
LuminosityBlockSummaryCacheHolder(LuminosityBlockSummaryCacheHolder<T, C> const&) = delete;
LuminosityBlockSummaryCacheHolder<T, C>& operator=(LuminosityBlockSummaryCacheHolder<T, C> const&) = delete;
~LuminosityBlockSummaryCacheHolder() noexcept(false){};
~LuminosityBlockSummaryCacheHolder() noexcept(false) override{};

private:
void preallocLumisSummary(unsigned int iNLumis) final { caches_.reset(new std::shared_ptr<C>[iNLumis]); }
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace edm {
EndRunSummaryProducer(edm::ParameterSet const& iPSet) : T(iPSet), RunSummaryCacheHolder<T, C>(iPSet) {}
EndRunSummaryProducer(EndRunSummaryProducer const&) = delete;
EndRunSummaryProducer& operator=(EndRunSummaryProducer const&) = delete;
~EndRunSummaryProducer() noexcept(false){};
~EndRunSummaryProducer() noexcept(false) override{};

private:
void doEndRunProduce_(Run& rp, EventSetup const& c) final {
Expand Down Expand Up @@ -295,7 +295,7 @@ namespace edm {
: T(iPSet), LuminosityBlockSummaryCacheHolder<T, S>(iPSet) {}
EndLuminosityBlockSummaryProducer(EndLuminosityBlockSummaryProducer const&) = delete;
EndLuminosityBlockSummaryProducer& operator=(EndLuminosityBlockSummaryProducer const&) = delete;
~EndLuminosityBlockSummaryProducer() noexcept(false){};
~EndLuminosityBlockSummaryProducer() noexcept(false) override{};

private:
void doEndLuminosityBlockProduce_(LuminosityBlock& lb, EventSetup const& c) final {
Expand Down
8 changes: 4 additions & 4 deletions FWCore/Framework/interface/stream/ThinningProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ namespace edm {
class ThinningProducer : public stream::EDProducer<> {
public:
explicit ThinningProducer(ParameterSet const& pset);
virtual ~ThinningProducer();
~ThinningProducer() override;

static void fillDescriptions(ConfigurationDescriptions& descriptions);

virtual void produce(Event& event, EventSetup const& eventSetup) override;
void produce(Event& event, EventSetup const& eventSetup) override;

virtual void registerThinnedAssociations(ProductRegistry const& productRegistry,
ThinnedAssociationsHelper& thinnedAssociationsHelper) override;
void registerThinnedAssociations(ProductRegistry const& productRegistry,
ThinnedAssociationsHelper& thinnedAssociationsHelper) override;

private:
edm::propagate_const<std::unique_ptr<Selector>> selector_;
Expand Down
10 changes: 5 additions & 5 deletions FWCore/SOA/interface/TableExaminer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,27 @@ namespace edm {

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

size_t size() const override final { return m_table->size(); }
size_t size() const final { return m_table->size(); }

void const* columnAddress(unsigned int iColumnIndex) const override final {
void const* columnAddress(unsigned int iColumnIndex) const final {
return m_table->columnAddressByIndex(iColumnIndex);
}

std::vector<std::type_index> columnTypes() const override final {
std::vector<std::type_index> columnTypes() const final {
std::vector<std::type_index> returnValue;
returnValue.reserve(T::kNColumns);
columnTypesImpl<0, T::kNColumns>(returnValue);
return returnValue;
}

std::vector<std::pair<char const*, std::type_index>> columnDescriptions() const override final {
std::vector<std::pair<char const*, std::type_index>> columnDescriptions() const final {
std::vector<std::pair<char const*, std::type_index>> returnValue;
returnValue.reserve(T::kNColumns);
columnDescImpl<0, T::kNColumns>(returnValue);
return returnValue;
}

const std::type_info* typeID() const override final { return &typeid(T); }
const std::type_info* typeID() const final { return &typeid(T); }

private:
template <int I, int S>
Expand Down
6 changes: 3 additions & 3 deletions FWCore/Utilities/interface/ECGetterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ namespace edm {
template <class T>
class ECGetterBase {
public:
ECGetterBase() : data_(0) {}
ECGetterBase() : data_(nullptr) {}
virtual ~ECGetterBase() {}

// ---------- const member functions ---------------------
const T* get() const {
if (data_ == 0) {
if (data_ == nullptr) {
data_ = this->getImpl();
}
return data_;
Expand All @@ -58,7 +58,7 @@ namespace edm {
ValueHolderECGetter(const T& iValue) : value_(&iValue) {}

private:
virtual const T* getImpl() const { return value_; }
const T* getImpl() const override { return value_; }
const T* value_;
};
} // namespace edm
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Utilities/interface/ExtensionCord.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace edm {
const T& operator*() const { return *(this->get()); }

///Returns true if the ExtensionCord is connected to an outlet and can therefore deliver data
bool connected() const { return 0 != holder_->getter_; }
bool connected() const { return nullptr != holder_->getter_; }
// ---------- static member functions --------------------

// ---------- member functions ---------------------------
Expand Down
6 changes: 3 additions & 3 deletions FWCore/Utilities/interface/OutletBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ namespace edm {
class OutletBase {
protected:
OutletBase(ExtensionCord<T>& iCord) : cord_(iCord) {}
virtual ~OutletBase() { this->setGetter(0); }
virtual ~OutletBase() { this->setGetter(nullptr); }

void setGetter(extensioncord::ECGetterBase<T>* iGetter) { cord_.setGetter(iGetter); }

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

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

// ---------- member data --------------------------------
ExtensionCord<T>& cord_;
Expand Down
4 changes: 2 additions & 2 deletions FWCore/Utilities/interface/SimpleOutlet.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ namespace edm {
}

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

const SimpleOutlet& operator=(const SimpleOutlet&); // stop default
const SimpleOutlet& operator=(const SimpleOutlet&) = delete; // stop default
};

} // namespace edm
Expand Down