DeckIntItem.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2013 Statoil 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 #ifndef DECKINTITEM_HPP
21 #define DECKINTITEM_HPP
22 
23 #include <string>
24 #include <vector>
25 #include <deque>
26 #include <memory>
28 
29 namespace Opm {
30 
31  class DeckIntItem : public DeckItem {
32  public:
33  DeckIntItem(std::string name_, bool scalar = true) : DeckItem(name_, scalar) {}
34  int getInt(size_t index) const;
35  const std::vector<int>& getIntData() const;
36 
37 
38  void push_back(std::deque<int> data , size_t items);
39  void push_back(std::deque<int> data);
40  void push_back(int value);
41  // trying to access the data of a "dummy default item" will raise an exception
42  void push_backDummyDefault();
43  void push_backMultiple(int value , size_t numValues);
44  void push_backDefault(int value);
45 
46  size_t size() const;
47  private:
48  std::vector<int> m_data;
49  };
50 
51  typedef std::shared_ptr<DeckIntItem> DeckIntItemPtr;
52  typedef std::shared_ptr<const DeckIntItem> DeckIntItemConstPtr;
53 }
54 #endif /* DECKINTITEM_HPP */
55 
void push_backDefault(int value)
std::shared_ptr< DeckIntItem > DeckIntItemPtr
Definition: DeckIntItem.hpp:51
Definition: Deck.hpp:29
DeckIntItem(std::string name_, bool scalar=true)
Definition: DeckIntItem.hpp:33
size_t size() const
void push_backDummyDefault()
Definition: DeckItem.hpp:31
void push_backMultiple(int value, size_t numValues)
void push_back(std::deque< int > data, size_t items)
Definition: DeckIntItem.hpp:31
std::shared_ptr< const DeckIntItem > DeckIntItemConstPtr
Definition: DeckIntItem.hpp:52
const std::vector< int > & getIntData() const
int getInt(size_t index) const