make WList constructible from variables
also make it default constructible, add accessors and equality operator
This commit is contained in:
@@ -26,14 +26,20 @@ namespace Opm {
|
||||
class WList {
|
||||
public:
|
||||
using storage = std::unordered_set<std::string>;
|
||||
|
||||
WList() = default;
|
||||
WList(const storage& wlist);
|
||||
std::size_t size() const;
|
||||
void add(const std::string& well);
|
||||
void del(const std::string& well);
|
||||
bool has(const std::string& well) const;
|
||||
|
||||
std::vector<std::string> wells() const;
|
||||
const storage& wellList() const;
|
||||
storage::const_iterator begin() const;
|
||||
storage::const_iterator end() const;
|
||||
|
||||
bool operator==(const WList& data) const;
|
||||
private:
|
||||
storage well_list;
|
||||
};
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
WList::WList(const storage& wlist) :
|
||||
well_list(wlist)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
std::size_t WList::size() const {
|
||||
return this->well_list.size();
|
||||
@@ -51,4 +56,12 @@ WList::storage::const_iterator WList::end() const {
|
||||
return this->well_list.end();
|
||||
}
|
||||
|
||||
const WList::storage& WList::wellList() const {
|
||||
return this->well_list;
|
||||
}
|
||||
|
||||
bool WList::operator==(const WList& data) const {
|
||||
return this->wellList() == data.wellList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user