Samchon Framework for CPP  1.0.0
ErrorEvent.hpp
1 #pragma once
2 
3 #include <samchon/library/Event.hpp>
4 
5 #include <string>
6 
7 namespace samchon
8 {
9 namespace library
10 {
18  class ErrorEvent
19  : public Event
20  {
21  private:
22  typedef Event super;
23 
24  enum : int
25  {
26  ACTIVATE = 1,
27  COMPLETE = 2,
28  REMOVED = -1
29  };
30 
31  protected:
35  std::string message;
36 
37  public:
38  enum : int
39  {
40  ERROR = 0
41  };
42 
50  ErrorEvent(EventDispatcher *source, const std::string &message)
51  : super(source, ErrorEvent::ERROR)
52  {
53  this->message = message;
54  };
55  virtual ~ErrorEvent() = default;
56 
60  auto getMessage() const -> std::string
61  {
62  return message;
63  };
64  };
65 };
66 };
std::string message
Error message.
Definition: ErrorEvent.hpp:35
Event representing an error.
Definition: ErrorEvent.hpp:18
ErrorEvent(EventDispatcher *source, const std::string &message)
Construct from source and error-id.
Definition: ErrorEvent.hpp:50
EventDispatcher * source
Source of the event.
Definition: Event.hpp:55
Represent an event running on background.
Definition: Event.hpp:41
auto getMessage() const -> std::string
Get error-id.
Definition: ErrorEvent.hpp:60
Abstract class for dispatching Event.