GDCM: gdcmEvent.h Source File

GDCM 3.2.10

gdcmEvent.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMEVENT_H
15#define GDCMEVENT_H
16
17#include "gdcmTypes.h"
18
19namespace gdcm
20{
21//-----------------------------------------------------------------------------
26 class GDCM_EXPORT Event
27{
28public :
29 Event();
30 virtual ~Event();
31 Event(const Event&);
32 void operator=(const Event&) = delete;
33
36 virtual Event* MakeObject() const = 0;
37
41 virtual void Print(std::ostream& os) const;
42
44 virtual const char * GetEventName() const = 0;
45
47 virtual bool CheckEvent(const Event*) const = 0;
48
49};
50
52 inline std::ostream& operator<<(std::ostream& os, const Event &e)
53{
54 e.Print(os);
55 return os;
56}
57
58/*
59 * Macro for creating new Events
60 */
61#define gdcmEventMacro( classname , super ) \
62 \
63 class classname : public super { \
64 public: \
65 typedef classname Self; \
66 typedef super Superclass; \
67 classname() {} \
68 virtual ~classname() override = default; \
69 virtual const char * GetEventName() const override { return #classname; } \
70 virtual bool CheckEvent(const ::gdcm::Event* e) const override \
71 { return dynamic_cast<const Self*>(e) ? true : false; } \
72 virtual ::gdcm::Event* MakeObject() const override \
73 { return new Self; } \
74 classname(const Self&s) : super(s){} \
75 private: \
76 void operator=(const Self&); \
77 }
78
82 gdcmEventMacro( NoEvent , Event );
83 gdcmEventMacro( AnyEvent , Event );
84 gdcmEventMacro( StartEvent , AnyEvent );
85 gdcmEventMacro( EndEvent , AnyEvent );
86//gdcmEventMacro( ProgressEvent , AnyEvent );
87 gdcmEventMacro( ExitEvent , AnyEvent );
88 gdcmEventMacro( AbortEvent , AnyEvent );
89 gdcmEventMacro( ModifiedEvent , AnyEvent );
90 gdcmEventMacro( InitializeEvent , AnyEvent );
91 gdcmEventMacro( IterationEvent , AnyEvent );
92//gdcmEventMacro( AnonymizeEvent , AnyEvent );
93 gdcmEventMacro( UserEvent , AnyEvent );
94
95
96} // end namespace gdcm
97//-----------------------------------------------------------------------------
98#endif //GDCMEVENT_H
gdcm::AbortEvent
Definition gdcmEvent.h:88
gdcm::AnyEvent
Definition gdcmEvent.h:83
gdcm::EndEvent
Definition gdcmEvent.h:85
gdcm::Event
superclass for callback/observer methods
Definition gdcmEvent.h:27
gdcm::Event::Event
Event()
gdcm::Event::GetEventName
virtual const char * GetEventName() const =0
gdcm::Event::operator=
void operator=(const Event &)=delete
gdcm::Event::Event
Event(const Event &)
gdcm::Event::Print
virtual void Print(std::ostream &os) const
gdcm::Event::CheckEvent
virtual bool CheckEvent(const Event *) const =0
gdcm::Event::~Event
virtual ~Event()
gdcm::Event::MakeObject
virtual Event * MakeObject() const =0
gdcm::ExitEvent
Definition gdcmEvent.h:87
gdcm::InitializeEvent
Definition gdcmEvent.h:90
gdcm::IterationEvent
Definition gdcmEvent.h:91
gdcm::ModifiedEvent
Definition gdcmEvent.h:89
gdcm::NoEvent
Definition gdcmEvent.h:82
gdcm::StartEvent
Definition gdcmEvent.h:84
gdcm::UserEvent
Definition gdcmEvent.h:93
gdcmEventMacro
#define gdcmEventMacro(classname, super)
Definition gdcmEvent.h:61
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88