23#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
25#include <unordered_map>
32 typedef std::vector<std::reference_wrapper<const DeckKeyword>> storage_type;
35 struct Iterator :
public storage_type::iterator {
36 Iterator(storage_type::const_iterator inner_iter) :
40 const DeckKeyword& operator*() {
return this->inner->get(); }
41 const DeckKeyword* operator->() {
return &this->inner->get(); }
43 Iterator& operator++() { ++this->inner;
return *
this; }
44 Iterator operator++(
int) {
auto tmp = *
this; ++this->inner;
return tmp; }
47 Iterator& operator--() { --this->inner;
return *
this; }
48 Iterator operator--(
int) {
auto tmp = *
this; --this->inner;
return tmp; }
50 Iterator::difference_type operator-(
const Iterator &other) {
return this->inner - other.inner; }
51 Iterator operator+(Iterator::difference_type shift) {
Iterator tmp = *
this; tmp.inner += shift;
return tmp;}
53 friend bool operator== (
const Iterator& a,
const Iterator& b) {
return a.inner == b.inner; };
54 friend bool operator!= (
const Iterator& a,
const Iterator& b) {
return a.inner != b.inner; };
56 storage_type::const_iterator inner;
60 Iterator end()
const {
return Iterator(this->keywords.end()); }
62 const DeckKeyword& operator[](std::size_t index)
const;
63 DeckView operator[](
const std::string& keyword)
const;
64 std::vector<std::size_t> index(
const std::string& keyword)
const;
65 std::size_t count(
const std::string& keyword)
const;
66 const DeckKeyword& front()
const;
67 const DeckKeyword& back()
const;
70 void add_keyword(
const DeckKeyword& kw);
71 bool has_keyword(
const std::string& kw)
const;
73 std::size_t size()
const;
75 template<
class Keyword>
76 bool has_keyword()
const {
77 return this->has_keyword( Keyword::keywordName );
80 template<
class Keyword>
81 DeckView get()
const {
82 return this->operator[](Keyword::keywordName);
86 storage_type keywords;
87 std::unordered_map<std::string, std::vector<std::size_t>> keyword_index;
Definition: DeckKeyword.hpp:36
Definition: DeckView.hpp:30
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: DeckView.hpp:35