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

Fixes to eliminate warnings from scram b check-headers #23626

Merged
merged 1 commit into from
Jun 20, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions DataFormats/Provenance/interface/IndexIntoFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ namespace edm {
template <>
struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
static IndexIntoFile::IndexIntoFileItrImpl* clone(IndexIntoFile::IndexIntoFileItrImpl const* p) {return p->clone();}
static void destroy(IndexIntoFile::IndexIntoFileItrImpl* p) { delete p; }
};


Expand Down
9 changes: 9 additions & 0 deletions FWCore/ParameterSet/interface/AllowedLabelsDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand Down Expand Up @@ -34,6 +35,10 @@ namespace edm {
{
}

~AllowedLabelsDescription() override
{
}

ParameterDescriptionNode* clone() const override {
return new AllowedLabelsDescription(*this);
}
Expand Down Expand Up @@ -67,6 +72,8 @@ namespace edm {
ParameterSetDescription const& value,
bool isTracked);

~AllowedLabelsDescription() override;

ParameterDescriptionNode* clone() const override;

private:
Expand Down Expand Up @@ -100,6 +107,8 @@ namespace edm {
ParameterSetDescription const& value,
bool isTracked);

~AllowedLabelsDescription() override;

ParameterDescriptionNode* clone() const override;

private:
Expand Down
1 change: 1 addition & 0 deletions FWCore/ParameterSet/interface/ParameterDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand Down
1 change: 1 addition & 0 deletions FWCore/ParameterSet/interface/ParameterDescriptionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ namespace edm {
template <>
struct value_ptr_traits<ParameterDescriptionNode> {
static ParameterDescriptionNode* clone(ParameterDescriptionNode const* p) { return p->clone(); }
static void destroy(ParameterDescriptionNode* p) { delete p; }
};

// operator>> ---------------------------------------------
Expand Down
16 changes: 16 additions & 0 deletions FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h
Original file line number Diff line number Diff line change
@@ -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<ParameterSetDescription> {
static ParameterSetDescription* clone(ParameterSetDescription const* p);
static void destroy(ParameterSetDescription* p);
};
}
#endif
1 change: 1 addition & 0 deletions FWCore/ParameterSet/interface/ParameterWildcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand Down
2 changes: 1 addition & 1 deletion FWCore/ParameterSet/interface/VParameterSetEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace edm {
void fillVPSet() const;
ParameterSet& psetInVector(int i);

std::vector<ParameterSet>::size_type size() const { return vpset().size(); }
std::vector<ParameterSet>::size_type size() const;

void registerPsetsAndUpdateIDs();

Expand Down
8 changes: 8 additions & 0 deletions FWCore/ParameterSet/src/AllowedLabelsDescription.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ namespace edm {
{
}

AllowedLabelsDescription<ParameterSetDescription>::~AllowedLabelsDescription()
{
}

ParameterDescriptionNode*
AllowedLabelsDescription<ParameterSetDescription>::
clone() const {
Expand Down Expand Up @@ -136,6 +140,10 @@ namespace edm {
{
}

AllowedLabelsDescription<std::vector<ParameterSet> >::~AllowedLabelsDescription()
{
}

ParameterDescriptionNode*
AllowedLabelsDescription<std::vector<ParameterSet> >::
clone() const {
Expand Down
13 changes: 13 additions & 0 deletions FWCore/ParameterSet/src/ParameterSetDescriptionTraits.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "FWCore/ParameterSet/interface/ParameterSetDescriptionTraits.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

namespace edm {

ParameterSetDescription* value_ptr_traits<ParameterSetDescription>::clone(ParameterSetDescription const* p) {
return new ParameterSetDescription(*p);
}

void value_ptr_traits<ParameterSetDescription>::destroy(ParameterSetDescription* p) {
delete p;
}
}
4 changes: 4 additions & 0 deletions FWCore/ParameterSet/src/VParameterSetEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ namespace edm {
return theVPSet_->at(i);
}

std::vector<ParameterSet>::size_type VParameterSetEntry::size() const {
return vpset().size();
}

void VParameterSetEntry::registerPsetsAndUpdateIDs() {
fillVPSet();
theIDs_ = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
Expand Down
3 changes: 2 additions & 1 deletion FWCore/Utilities/interface/value_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace edm {
template <typename T>
struct value_ptr_traits {
static T* clone(T const* p) { return new T(*p); }
static void destroy(T* p) { delete p; }
};

// --------------------------------------------------------------------
Expand All @@ -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<T>::destroy(myP.get()); }

// --------------------------------------------------
// Copy constructor/copy assignment:
Expand Down