Interface to register interest in receiving notifications when a certain event, such as the completion of a timestep, has happened. More...
#include <Event.hpp>
Public Member Functions | |
virtual Event & | add (const std::function< void()> &handler)=0 |
Register a callback to receive notifications from this event. More... | |
template<typename T , void(T::*)() member> | |
Event & | add (T &t) |
Convenience routine to add a member function of a class as an event handler. More... | |
template<typename T , void(T::*)() member> | |
Event & | add (T &t) |
Interface to register interest in receiving notifications when a certain event, such as the completion of a timestep, has happened.
|
pure virtual |
Register a callback to receive notifications from this event.
[in] | handler | Function object that will be invoked when the event happens. |
Event& Opm::Event::add | ( | T & | t | ) |
Convenience routine to add a member function of a class as an event handler.
This allows us to have all the necessary information the handler needs put into an object, and then register this with the event.