From 9c4a6cb38be5298b322d8b3cfa6bc968ec713845 Mon Sep 17 00:00:00 2001 From: "W. David Dagenhart" Date: Tue, 19 Jun 2018 13:35:07 -0500 Subject: [PATCH] Fixes to eliminate warnings from scram b check-headers --- DataFormats/Provenance/interface/IndexIntoFile.h | 1 + .../interface/AllowedLabelsDescription.h | 9 +++++++++ .../interface/ParameterDescription.h | 1 + .../interface/ParameterDescriptionNode.h | 1 + .../interface/ParameterSetDescriptionTraits.h | 16 ++++++++++++++++ .../ParameterSet/interface/ParameterWildcard.h | 1 + .../ParameterSet/interface/VParameterSetEntry.h | 2 +- .../ParameterSet/src/AllowedLabelsDescription.cc | 8 ++++++++ .../src/ParameterSetDescriptionTraits.cc | 13 +++++++++++++ FWCore/ParameterSet/src/VParameterSetEntry.cc | 4 ++++ FWCore/Utilities/interface/value_ptr.h | 3 ++- 11 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h create mode 100644 FWCore/ParameterSet/src/ParameterSetDescriptionTraits.cc diff --git a/DataFormats/Provenance/interface/IndexIntoFile.h b/DataFormats/Provenance/interface/IndexIntoFile.h index 31e1ab98b93f3..e2952f0d81607 100644 --- a/DataFormats/Provenance/interface/IndexIntoFile.h +++ b/DataFormats/Provenance/interface/IndexIntoFile.h @@ -1115,6 +1115,7 @@ namespace edm { template <> struct value_ptr_traits { static IndexIntoFile::IndexIntoFileItrImpl* clone(IndexIntoFile::IndexIntoFileItrImpl const* p) {return p->clone();} + static void destroy(IndexIntoFile::IndexIntoFileItrImpl* p) { delete p; } }; diff --git a/FWCore/ParameterSet/interface/AllowedLabelsDescription.h b/FWCore/ParameterSet/interface/AllowedLabelsDescription.h index 372462f9482a2..b67a5ce97ee2a 100644 --- a/FWCore/ParameterSet/interface/AllowedLabelsDescription.h +++ b/FWCore/ParameterSet/interface/AllowedLabelsDescription.h @@ -5,6 +5,7 @@ #include "FWCore/ParameterSet/interface/AllowedLabelsDescriptionBase.h" #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h" #include "FWCore/Utilities/interface/value_ptr.h" #include @@ -34,6 +35,10 @@ namespace edm { { } + ~AllowedLabelsDescription() override + { + } + ParameterDescriptionNode* clone() const override { return new AllowedLabelsDescription(*this); } @@ -67,6 +72,8 @@ namespace edm { ParameterSetDescription const& value, bool isTracked); + ~AllowedLabelsDescription() override; + ParameterDescriptionNode* clone() const override; private: @@ -100,6 +107,8 @@ namespace edm { ParameterSetDescription const& value, bool isTracked); + ~AllowedLabelsDescription() override; + ParameterDescriptionNode* clone() const override; private: diff --git a/FWCore/ParameterSet/interface/ParameterDescription.h b/FWCore/ParameterSet/interface/ParameterDescription.h index 4270313a78aad..8cad48072c5d0 100644 --- a/FWCore/ParameterSet/interface/ParameterDescription.h +++ b/FWCore/ParameterSet/interface/ParameterDescription.h @@ -20,6 +20,7 @@ #include "FWCore/ParameterSet/interface/ParameterDescriptionBase.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h" #include "FWCore/Utilities/interface/value_ptr.h" #include diff --git a/FWCore/ParameterSet/interface/ParameterDescriptionNode.h b/FWCore/ParameterSet/interface/ParameterDescriptionNode.h index afa641964c921..19b9f4171aa73 100644 --- a/FWCore/ParameterSet/interface/ParameterDescriptionNode.h +++ b/FWCore/ParameterSet/interface/ParameterDescriptionNode.h @@ -270,6 +270,7 @@ namespace edm { template <> struct value_ptr_traits { static ParameterDescriptionNode* clone(ParameterDescriptionNode const* p) { return p->clone(); } + static void destroy(ParameterDescriptionNode* p) { delete p; } }; // operator>> --------------------------------------------- diff --git a/FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h b/FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h new file mode 100644 index 0000000000000..9825405819802 --- /dev/null +++ b/FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h @@ -0,0 +1,16 @@ +#ifndef FWCore_ParameterSet_ParameterSetTraits_h +#define FWCore_ParameterSet_ParameterSetTraits_h + +#include "FWCore/Utilities/interface/value_ptr.h" + +namespace edm { + + class ParameterSetDescription; + + template <> + struct value_ptr_traits { + static ParameterSetDescription* clone(ParameterSetDescription const* p); + static void destroy(ParameterSetDescription* p); + }; +} +#endif diff --git a/FWCore/ParameterSet/interface/ParameterWildcard.h b/FWCore/ParameterSet/interface/ParameterWildcard.h index 5faa8c72c3d34..c7f1f80fa451d 100644 --- a/FWCore/ParameterSet/interface/ParameterWildcard.h +++ b/FWCore/ParameterSet/interface/ParameterWildcard.h @@ -4,6 +4,7 @@ #include "FWCore/ParameterSet/interface/ParameterWildcardBase.h" #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h" #include "FWCore/Utilities/interface/value_ptr.h" #include diff --git a/FWCore/ParameterSet/interface/VParameterSetEntry.h b/FWCore/ParameterSet/interface/VParameterSetEntry.h index dea2267f7d26d..e048d46a9846f 100644 --- a/FWCore/ParameterSet/interface/VParameterSetEntry.h +++ b/FWCore/ParameterSet/interface/VParameterSetEntry.h @@ -42,7 +42,7 @@ namespace edm { void fillVPSet() const; ParameterSet& psetInVector(int i); - std::vector::size_type size() const { return vpset().size(); } + std::vector::size_type size() const; void registerPsetsAndUpdateIDs(); diff --git a/FWCore/ParameterSet/src/AllowedLabelsDescription.cc b/FWCore/ParameterSet/src/AllowedLabelsDescription.cc index 085670f58051c..059e37fd7e533 100644 --- a/FWCore/ParameterSet/src/AllowedLabelsDescription.cc +++ b/FWCore/ParameterSet/src/AllowedLabelsDescription.cc @@ -41,6 +41,10 @@ namespace edm { { } + AllowedLabelsDescription::~AllowedLabelsDescription() + { + } + ParameterDescriptionNode* AllowedLabelsDescription:: clone() const { @@ -136,6 +140,10 @@ namespace edm { { } + AllowedLabelsDescription >::~AllowedLabelsDescription() + { + } + ParameterDescriptionNode* AllowedLabelsDescription >:: clone() const { diff --git a/FWCore/ParameterSet/src/ParameterSetDescriptionTraits.cc b/FWCore/ParameterSet/src/ParameterSetDescriptionTraits.cc new file mode 100644 index 0000000000000..4e533526af052 --- /dev/null +++ b/FWCore/ParameterSet/src/ParameterSetDescriptionTraits.cc @@ -0,0 +1,13 @@ +#include "FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +namespace edm { + + ParameterSetDescription* value_ptr_traits::clone(ParameterSetDescription const* p) { + return new ParameterSetDescription(*p); + } + + void value_ptr_traits::destroy(ParameterSetDescription* p) { + delete p; + } +} diff --git a/FWCore/ParameterSet/src/VParameterSetEntry.cc b/FWCore/ParameterSet/src/VParameterSetEntry.cc index fe8d2e4a106b0..c4cc8c018278f 100644 --- a/FWCore/ParameterSet/src/VParameterSetEntry.cc +++ b/FWCore/ParameterSet/src/VParameterSetEntry.cc @@ -114,6 +114,10 @@ namespace edm { return theVPSet_->at(i); } + std::vector::size_type VParameterSetEntry::size() const { + return vpset().size(); + } + void VParameterSetEntry::registerPsetsAndUpdateIDs() { fillVPSet(); theIDs_ = value_ptr >(new std::vector); diff --git a/FWCore/Utilities/interface/value_ptr.h b/FWCore/Utilities/interface/value_ptr.h index 417b9c11da632..937e309e3ea76 100644 --- a/FWCore/Utilities/interface/value_ptr.h +++ b/FWCore/Utilities/interface/value_ptr.h @@ -51,6 +51,7 @@ namespace edm { template struct value_ptr_traits { static T* clone(T const* p) { return new T(*p); } + static void destroy(T* p) { delete p; } }; // -------------------------------------------------------------------- @@ -71,7 +72,7 @@ namespace edm { value_ptr() : myP(nullptr) { } explicit value_ptr(T* p) : myP(p) { } - ~value_ptr() { delete myP.get(); } + ~value_ptr() { value_ptr_traits::destroy(myP.get()); } // -------------------------------------------------- // Copy constructor/copy assignment: