Samchon Framework for CPP  1.0.0
Event.hpp
1 #pragma once
2 
3 namespace samchon
4 {
5 namespace library
6 {
7  class EventDispatcher;
8 
41  class Event
42  {
43  public:
44  enum : int
45  {
46  ACTIVATE = 1,
47  COMPLETE = 2,
48  REMOVED = -1
49  };
50 
51  protected:
56 
60  int type;
61 
62  public:
70  Event(EventDispatcher *source, int type)
71  {
72  this->source = source;
73  this->type = type;
74  };
75  virtual ~Event() = default;
76 
80  auto getSource() const -> EventDispatcher*
81  {
82  return source;
83  };
84 
88  auto getType() const -> int
89  {
90  return type;
91  };
92  };
93 };
94 };
Event(EventDispatcher *source, int type)
Construct from source and type.
Definition: Event.hpp:70
EventDispatcher * source
Source of the event.
Definition: Event.hpp:55
auto getSource() const -> EventDispatcher *
Get source of the Event.
Definition: Event.hpp:80
Represent an event running on background.
Definition: Event.hpp:41
int type
Type of the event.
Definition: Event.hpp:60
Abstract class for dispatching Event.
auto getType() const -> int
Get type of the Event.
Definition: Event.hpp:88