Go to the documentation of this file.00001 #ifndef rgrl_event_h_
00002 #define rgrl_event_h_
00003
00004
00005
00006
00007
00008
00009 #include <vbl/vbl_ref_count.h>
00010 #include <vcl_string.h>
00011 #include "rgrl_event_sptr.h"
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 class rgrl_event: public vbl_ref_count
00024 {
00025 public:
00026
00027 rgrl_event() {}
00028
00029
00030 rgrl_event(rgrl_event const&) : vbl_ref_count() {}
00031
00032
00033 virtual ~rgrl_event() {}
00034
00035
00036 virtual vcl_string name(void) const = 0;
00037
00038 virtual bool is_same_type(rgrl_event const& e) const = 0;
00039 };
00040
00041
00042 #define EventMacro( classname ) \
00043 class classname : public rgrl_event { \
00044 public: \
00045 classname() {} \
00046 classname(classname const& c) : rgrl_event(c) {} \
00047 virtual ~classname() {} \
00048 virtual vcl_string name() const { return #classname; } \
00049 virtual bool is_same_type(rgrl_event const& e) const \
00050 { rgrl_event const* p=&e; return dynamic_cast<classname const*>(p) ? true : false; } \
00051 }
00052
00053
00054
00055
00056 EventMacro( rgrl_event_start );
00057 EventMacro( rgrl_event_end );
00058 EventMacro( rgrl_event_iteration );
00059 EventMacro( rgrl_event_verification );
00060 EventMacro( rgrl_event_next_init );
00061 EventMacro( rgrl_matches_formed );
00062
00063 #endif