Well, I've come to a conclusion . . .
[aesalon.git] / src / platform / Event.h
blobf23839bb5ad65e34e10d74d20627825f076eaf98
1 #ifndef AESALON_PLATFORM_EVENT_H
2 #define AESALON_PLATFORM_EVENT_H
4 #include <string>
6 #include "misc/SmartPointer.h"
8 namespace Aesalon {
9 namespace Platform {
11 /** Event class. Note that until overloaded, this base class is rather
12 useless. */
13 class Event {
14 public:
15 /** Event type enum, used for dynamic_cast<>ing later. */
16 enum event_type_e {
17 BLOCK_EVENT
19 private:
20 /** Current event type. */
21 event_type_e type;
22 public:
23 /** Constructor, takes a type. All other stored data is in the derived
24 types. */
25 Event(event_type_e type) : type(type) {}
26 virtual ~Event() {}
28 /** Returns the type of the current event.
29 @return The type of the current event.
31 event_type_e get_type() const { return type; }
33 virtual std::string serialize();
34 static Misc::SmartPointer<Event> deserialize(std::string data);
37 } // namespace Platform
38 } // namespace Aesalon
40 #endif