33 typedef std::vector<std::reference_wrapper<const DeckKeyword>> storage_type;
37 explicit Iterator(storage_type::const_iterator inner_iter) :
41 using difference_type = storage_type::const_iterator::difference_type;
42 using iterator_category = storage_type::const_iterator::iterator_category;
47 const DeckKeyword& operator*() {
return this->inner->get(); }
48 const DeckKeyword* operator->() {
return &this->inner->get(); }
50 Iterator& operator++() { ++this->inner;
return *
this; }
51 Iterator operator++(
int) {
auto tmp = *
this; ++this->inner;
return tmp; }
53 Iterator& operator--() { --this->inner;
return *
this; }
54 Iterator operator--(
int) {
auto tmp = *
this; --this->inner;
return tmp; }
56 Iterator::difference_type operator-(
const Iterator &other) {
return this->inner - other.inner; }
57 Iterator operator+(Iterator::difference_type shift) {
Iterator tmp = *
this; tmp.inner += shift;
return tmp;}
59 friend bool operator== (
const Iterator& a,
const Iterator& b) {
return a.inner == b.inner; };
60 friend bool operator<= (
const Iterator& a,
const Iterator& b) {
return a.inner <= b.inner; };
61 friend bool operator!= (
const Iterator& a,
const Iterator& b) {
return a.inner != b.inner; };
64 storage_type::const_iterator inner;
68 Iterator end()
const {
return Iterator(this->keywords.end()); }
70 const DeckKeyword& operator[](std::size_t index)
const;
71 DeckView operator[](
const std::string& keyword)
const;
72 std::vector<std::size_t> index(
const std::string& keyword)
const;
73 std::size_t count(
const std::string& keyword)
const;
74 const DeckKeyword& front()
const;
75 const DeckKeyword& back()
const;
78 void add_keyword(
const DeckKeyword& kw);
79 bool has_keyword(
const std::string& kw)
const;
81 std::size_t size()
const;
83 template<
class Keyword>
84 bool has_keyword()
const {
85 return this->has_keyword( Keyword::keywordName );
88 template<
class Keyword>
89 DeckView get()
const {
90 return this->operator[](Keyword::keywordName);
94 storage_type keywords;
95 std::unordered_map<std::string, std::vector<std::size_t>> keyword_index;
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30