Skip to content

Commit

Permalink
Make ymmsl::Settings copyable
Browse files Browse the repository at this point in the history
  • Loading branch information
LourensVeen committed Jan 14, 2024
1 parent 0ae11af commit 6aa7a2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libmuscle/cpp/src/ymmsl/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ std::ostream & operator<<(std::ostream & os, ymmsl::impl::SettingValue const & v
}


Settings::Settings(std::unordered_map<Reference, SettingValue> const & settings)
: store_(settings)
{}

bool Settings::operator==(Settings const & rhs) const {
return store_ == rhs.store_;
}
Expand Down
9 changes: 9 additions & 0 deletions libmuscle/cpp/src/ymmsl/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ class Settings {
// No, not going to type-erase this.
using const_iterator = MapType_::const_iterator;

/** Create an empty Settings object. */
Settings() = default;

/** Create a Settings object with the given settings.
*
* @param settings std::unordered_map<Reference, SettingValue> with settings.
*/
Settings(std::unordered_map<Reference, SettingValue> const & settings);

/** Compare Settings objects for equality.
*
* @return True iff the Settings are equal.
Expand Down

0 comments on commit 6aa7a2f

Please sign in to comment.