Event.hpp
Go to the documentation of this file.
1 #ifndef OPM_EVENT_HEADER_INCLUDED
2 #define OPM_EVENT_HEADER_INCLUDED
3 
4 // Copyright (C) 2013 Uni Research AS
5 // This file is licensed under the GNU General Public License v3.0
6 
7 #include <functional>
8 #include <list>
9 
10 namespace Opm {
11 
14 struct Event {
30  virtual Event& add (const std::function <void ()>& handler) = 0;
31 
37  template <typename T, void (T::*member)()> Event& add (T& t);
38 };
39 
84 class EventSource : public Event {
85 public:
86  virtual Event& add (const std::function <void ()>& handler);
87  virtual void signal ();
88 protected:
90  std::list <std::function <void ()> > handlers_;
91 };
92 
93 // inline definitions
94 #include "Event_impl.hpp"
95 
96 } /* namespace Opm */
97 
98 #endif /* OPM_EVENT_HEADER_INCLUDED */
Definition: AnisotropicEikonal.hpp:43
Definition: Event.hpp:14
virtual Event & add(const std::function< void()> &handler)=0