NRE_EventHandler.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <functional>
13  #include <Header/NRE_Utility.hpp>
14  #include "../../NRE_System.hpp"
15 
20  namespace NRE {
25  namespace Event {
26 
31  template <class T>
32  class EventHandler : public Utility::Observer {
33  public : // Fields
35  typedef std::function<bool(T&)> Handler;
36 
37  private : // Fields
38  Handler handler;
40  public : // Methods
41  //## Constructor ##//
45  EventHandler() = delete;
50  EventHandler(Handler && h);
51 
52  //## Copy Constructor ##//
57  EventHandler(EventHandler const& h) = delete;
58 
59  //## Move Constructor ##//
64  EventHandler(EventHandler && h) = delete;
65 
66  //## Deconstructor ##//
70  ~EventHandler();
71 
72  //## Methods ##//
78  void update(Utility::Observable* obs, void* arg) override;
79 
80  //## Assignment Operator ##//
86  EventHandler& operator =(EventHandler const& h) = delete;
92  EventHandler& operator =(EventHandler && h) = delete;
93  };
94  }
95  }
96 
97  #include "NRE_EventHandler.tpp"
EventHandler & operator=(EventHandler const &h)=delete
Event&#39;s API.
std::function< bool(T &)> Handler
Definition: NRE_EventHandler.hpp:35
void update(Utility::Observable *obs, void *arg) override
The NearlyRealEngine&#39;s global namespace.
Manage an event handler for a special type.
Definition: NRE_EventHandler.hpp:32