FunctorActivatorField.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Types/Activator.hpp"
4 #include "../Field.hpp"
5 #include <functional>
6 
7 namespace iv
8 {
9 
12 class FunctorActivatorField : public Field< Activator >
13 {
14 public:
16 
17  FunctorActivatorField( Instance * inst, std::function< void() > const & on_activated = nullptr );
18 
19  void on_activated( std::function< void() > const & );
20 
21 protected:
22  virtual void OnChanged( bool real ) override;
23 
24 private:
25  Activator _reference;
26  std::function< void() > _on_activated;
27 };
28 
29 }