InputEvent.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../TimeSystem/Watch.hpp"
4 #include "../DVarSystem/DVar.hpp"
6 
7 namespace iv
8 {
9 
13 class InputEvent : private PrivField_Owner< Activator >, private PrivField_Owner< SumAgg< int > >, protected PrivValAttr_Owner
14 {
15 public:
16 //----------------------------- instance control -------------------
18 
19  InputEvent( Instance * inst );
20  ~InputEvent();
21 
22  Instance * instance() const;
23  void status( iv::TableDebugView * view );
24 
25 //--------------------------------- observers ------------------
29 
35 
40 
47 
48 //--------------------------------- called by implementors -------------------------------------------
49 protected:
50  void ie_start_duration();
51  void ie_stop_duration();
52 
53  void ie_trigger();
54 
55  void ie_start_activation();
56  void ie_stop_activation( bool real );
57 
58 private:
59  virtual void Field_OnChanged( Field< Activator > * field, bool real ) override;
60  virtual void Field_OnChanged( Field< SumAgg< int > > * field, bool real ) override;
61 
62  void refresh_enabled();
63 
64  void check_consistency();
65 
66 private:
67  Instance * inst;
68 
69  bool release_hot;
70  bool duration;
71 
72  Activator press_reference;
73  Activator release_reference;
74 };
75 
76 }