#ifndef __libeast_event_h__ #define __libeast_event_h__ #include #include "smart_ptr.h" #include "object.h" class Object; // Basic event; shouldn't be used // Pretend it's abstract class Event: public RefCntObject { public: Event() {} virtual ~Event() {} virtual void throw_self() const {throw *this;} }; // Event with a source // Abstract class SourcedEvent: public Event { public: SourcedEvent(Object* source = NULL): my_source(source) {} virtual void throw_self() const {throw *this;} const Object* source() const {return my_source;} Object* source() {return my_source;} protected: Object* my_source; }; #endif