WList.hpp
Go to the documentation of this file.
1/*
2 Copyright 2019 Equinor ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include <cstddef>
20#include <unordered_set>
21#include <vector>
22#include <string>
23
24namespace Opm {
25
26class WList {
27public:
28 using storage = std::unordered_set<std::string>;
29
30 WList() = default;
31 WList(const storage& wlist);
32 std::size_t size() const;
33 void add(const std::string& well);
34 void del(const std::string& well);
35 bool has(const std::string& well) const;
36
37 std::vector<std::string> wells() const;
38 storage::const_iterator begin() const;
39 storage::const_iterator end() const;
40
41 bool operator==(const WList& data) const;
42
43 template<class Serializer>
44 void serializeOp(Serializer& serializer)
45 {
46 serializer(well_list);
47 }
48
49private:
50 storage well_list;
51};
52
53}
const char *const string
Definition: cJSON.h:170
Definition: Serializer.hpp:38
Definition: WList.hpp:26
WList()=default
void del(const std::string &well)
void serializeOp(Serializer &serializer)
Definition: WList.hpp:44
bool operator==(const WList &data) const
bool has(const std::string &well) const
std::vector< std::string > wells() const
void add(const std::string &well)
WList(const storage &wlist)
storage::const_iterator begin() const
std::unordered_set< std::string > storage
Definition: WList.hpp:28
storage::const_iterator end() const
std::size_t size() const
Definition: A.hpp:4
static std::string data()
Definition: exprtk.hpp:40022