GTNode.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
20#include <optional>
21#include <vector>
22
25
26#ifndef GROUPTREE2
27#define GROUPTREE2
28
29namespace Opm {
30
31class GTNode {
32public:
33 GTNode(const Group& group, std::size_t level, const std::optional<std::string>& parent_name);
34
35 void add_group(const GTNode& child_group);
36 void add_well(const Well& well);
37
38 const std::vector<Well>& wells() const;
39 const std::vector<GTNode>& groups() const;
40 const std::string& name() const;
41 const std::string& parent_name() const;
42
43 const Group& group() const;
44private:
45 const Group m_group;
46 std::size_t m_level;
47 std::optional<std::string> m_parent_name;
48 /*
49 Class T with a stl container <T> - supposedly undefined behavior before
50 C++17 - but it compiles without warnings.
51 */
52 std::vector<GTNode> m_child_groups;
53 std::vector<Well> m_wells;
54};
55
56}
57#endif
58
59
const char *const string
Definition: cJSON.h:170
Definition: GTNode.hpp:31
void add_well(const Well &well)
const std::string & parent_name() const
const std::vector< GTNode > & groups() const
GTNode(const Group &group, std::size_t level, const std::optional< std::string > &parent_name)
void add_group(const GTNode &child_group)
const std::string & name() const
const Group & group() const
const std::vector< Well > & wells() const
Definition: parser/eclipse/EclipseState/Schedule/Group/group.hpp:36
Definition: custom-opm-common/opm-common/opm/parser/eclipse/EclipseState/Schedule/Well/well.hpp:58
Definition: A.hpp:4