Began removal of platform/. The Monitor:: namespace is completely converted.
[aesalon.git] / src / misc / Event.cpp
blobf1880d91105e6373d8a03b4663e42a63eb3c0260
1 #include "Event.h"
2 #include "BlockEvent.h"
3 #include "StreamAsString.h"
4 #include "Exception.h"
6 namespace Aesalon {
7 namespace Misc {
9 std::string Event::serialize() {
10 if(type == BLOCK_EVENT) return Misc::StreamAsString() << 0x01;
11 throw Misc::Exception("Asked to serialize invalid Event");
14 Misc::SmartPointer<Event> Event::deserialize(std::string data) {
15 if(data[0] == '1') return BlockEvent::deserialize(data.substr(1));
16 return NULL;
19 } // namespace Misc
20 } // namespace Aesalon