CounterLog.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2014 Andreas Lauser
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 #ifndef OPM_COUNTERLOG_HPP
20 #define OPM_COUNTERLOG_HPP
21 
22 #include <string>
23 #include <vector>
24 #include <tuple>
25 #include <memory>
26 #include <map>
27 
30 
31 namespace Opm {
36  class CounterLog : public LogBackend {
37 public:
38 
39  CounterLog(int64_t messageMask);
40  CounterLog();
41 
42  size_t numMessages(int64_t messageType) const;
43 
44 
45  void addMessage(int64_t messageFlag ,
46  const std::string& message);
47 
48 
49  void clear();
51 private:
52  std::map<int64_t , size_t> m_count;
53 };
54 
55 typedef std::shared_ptr<CounterLog> CounterLogPtr;
56 typedef std::shared_ptr<const CounterLog> CounterLogConstPtr;
57 } // namespace Opm
58 
59 #endif
60 
Definition: Deck.hpp:29
size_t numMessages(int64_t messageType) const
void addMessage(int64_t messageFlag, const std::string &message)
Definition: LogBackend.hpp:29
std::shared_ptr< const CounterLog > CounterLogConstPtr
Definition: CounterLog.hpp:56
~CounterLog()
Definition: CounterLog.hpp:50
std::shared_ptr< CounterLog > CounterLogPtr
Definition: CounterLog.hpp:55
Provides a simple sytem for log message which are found by the Parser/Deck/EclipseState classes durin...
Definition: CounterLog.hpp:36