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

Explicitly allow ParameterSet and its internals to be moveable #24429

Merged
merged 2 commits into from
Sep 6, 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
6 changes: 5 additions & 1 deletion FWCore/ParameterSet/interface/Entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ namespace edm {
Entry(std::string const& name, std::string const& type,
std::vector<std::string> const& value, bool is_tracked);

~Entry();
~Entry() = default;
Entry(Entry const&) = default;
Entry(Entry&&) = default;
Entry& operator=(Entry const&) = default;
Entry& operator=(Entry&&) = default;
// encode

std::string toString() const;
Expand Down
11 changes: 5 additions & 6 deletions FWCore/ParameterSet/interface/ParameterSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ namespace edm {
// construct from coded string.
explicit ParameterSet(std::string const& rep);

~ParameterSet();

// instantiate in this library, so these methods don't cause code bloat
ParameterSet(ParameterSet const& other);

ParameterSet& operator=(ParameterSet const& other);
~ParameterSet() = default;
ParameterSet(ParameterSet const& other) = default;
ParameterSet(ParameterSet&& other) = default;
ParameterSet& operator=(ParameterSet const& other) = default;
ParameterSet& operator=(ParameterSet&& other) = default;

void swap(ParameterSet& other);

Expand Down
6 changes: 5 additions & 1 deletion FWCore/ParameterSet/interface/ParameterSetEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ namespace edm {
ParameterSetEntry(ParameterSetID const& id, bool isTracked);
explicit ParameterSetEntry(std::string const& rep);

~ParameterSetEntry();
~ParameterSetEntry() = default;
ParameterSetEntry(ParameterSetEntry const&) = default;
ParameterSetEntry(ParameterSetEntry&&) = default;
ParameterSetEntry& operator=(ParameterSetEntry const&) = default;
ParameterSetEntry& operator=(ParameterSetEntry&&) = default;

std::string toString() const;
void toString(std::string& result) const;
Expand Down
6 changes: 5 additions & 1 deletion FWCore/ParameterSet/interface/VParameterSetEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ namespace edm {
VParameterSetEntry(std::vector<ParameterSet> const& vpset, bool isTracked);
VParameterSetEntry(std::string const& rep);

~VParameterSetEntry();
~VParameterSetEntry() = default;
VParameterSetEntry(VParameterSetEntry const&) = default;
VParameterSetEntry(VParameterSetEntry&&) = default;
VParameterSetEntry& operator=(VParameterSetEntry const&) = default;
VParameterSetEntry& operator=(VParameterSetEntry&&) = default;

std::string toString() const;
void toString(std::string& result) const;
Expand Down
2 changes: 0 additions & 2 deletions FWCore/ParameterSet/src/Entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ namespace edm {
static pset::TypeTrans const sTypeTranslations;
typedef std::map<std::string, char> Type2Code;

Entry::~Entry() {}

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

ParameterSet::~ParameterSet() {}

void
ParameterSet::registerFromString(std::string const& rep) {
// from coded string. Will cause registration
Expand All @@ -107,19 +105,6 @@ namespace edm {
return ParameterSetID(newDigest.digest().toString());
}

ParameterSet::ParameterSet(ParameterSet const& other)
: tbl_(other.tbl_),
psetTable_(other.psetTable_),
vpsetTable_(other.vpsetTable_),
id_(other.id_) {
}

ParameterSet& ParameterSet::operator=(ParameterSet const& other) {
ParameterSet temp(other);
swap(temp);
return *this;
}

void ParameterSet::copyForModify(ParameterSet const& other) {
ParameterSet temp(other);
swap(temp);
Expand Down
2 changes: 0 additions & 2 deletions FWCore/ParameterSet/src/ParameterSetEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ namespace edm {
theID_.swap(newID);
}

ParameterSetEntry::~ParameterSetEntry() {}

void
ParameterSetEntry::toString(std::string& result) const {
result += isTracked() ? "+Q(" : "-Q(";
Expand Down
2 changes: 0 additions & 2 deletions FWCore/ParameterSet/src/VParameterSetEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ namespace edm {
}
}

VParameterSetEntry::~VParameterSetEntry() {}

void
VParameterSetEntry::toString(std::string& result) const {
assert(theIDs_);
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Utilities/interface/atomic_value_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace edm {
}

atomic_value_ptr(atomic_value_ptr&& orig) :
myP(orig.myP) { orig.myP.store(nullptr); }
myP(orig.myP.load()) { orig.myP.store(nullptr); }

atomic_value_ptr& operator=(atomic_value_ptr&& orig) {
atomic_value_ptr<T> local(orig);
Expand Down