Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMEVENT_H
00016 #define GDCMEVENT_H
00017
00018 #include "gdcmTypes.h"
00019
00020 namespace gdcm
00021 {
00022
00027 class GDCM_EXPORT Event
00028 {
00029 public :
00030 Event();
00031 Event(const Event&);
00032 virtual ~Event();
00033
00036 virtual Event* MakeObject() const = 0;
00037
00041 virtual void Print(std::ostream& os) const;
00042
00044 virtual const char * GetEventName(void) const = 0;
00045
00047 virtual bool CheckEvent(const Event*) const = 0;
00048
00049 protected:
00050 private:
00051 void operator=(const Event&);
00052 };
00053
00055 inline std::ostream& operator<<(std::ostream& os, Event &e)
00056 {
00057 e.Print(os);
00058 return os;
00059 }
00060
00061
00062
00063
00064 #define gdcmEventMacro( classname , super ) \
00065 \
00066 class classname : public super { \
00067 public: \
00068 typedef classname Self; \
00069 typedef super Superclass; \
00070 classname() {} \
00071 virtual ~classname() {} \
00072 virtual const char * GetEventName() const { return #classname; } \
00073 virtual bool CheckEvent(const ::gdcm::Event* e) const \
00074 { return dynamic_cast<const Self*>(e) ? true : false; } \
00075 virtual ::gdcm::Event* MakeObject() const \
00076 { return new Self; } \
00077 classname(const Self&s) : super(s){}; \
00078 private: \
00079 void operator=(const Self&); \
00080 }
00081
00085 gdcmEventMacro( NoEvent , Event );
00086 gdcmEventMacro( AnyEvent , Event );
00087 gdcmEventMacro( StartEvent , AnyEvent );
00088 gdcmEventMacro( EndEvent , AnyEvent );
00089
00090 gdcmEventMacro( ExitEvent , AnyEvent );
00091 gdcmEventMacro( AbortEvent , AnyEvent );
00092 gdcmEventMacro( ModifiedEvent , AnyEvent );
00093 gdcmEventMacro( InitializeEvent , AnyEvent );
00094 gdcmEventMacro( IterationEvent , AnyEvent );
00095
00096 gdcmEventMacro( UserEvent , AnyEvent );
00097
00098
00099 }
00100
00101 #endif //GDCMEVENT_H