gdcmEvent.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMEVENT_H
#define GDCMEVENT_H
#include "gdcmTypes.h"
namespace gdcm
{
//-----------------------------------------------------------------------------
class GDCM_EXPORT Event
{
public :
Event();
virtual ~Event();
Event(const Event&);
void operator=(const Event&) = delete;
virtual Event* MakeObject() const = 0;
virtual void Print(std::ostream& os) const;
virtual const char * GetEventName() const = 0;
virtual bool CheckEvent(const Event*) const = 0;
};
inline std::ostream& operator<<(std::ostream& os, const Event &e)
{
e.Print(os);
return os;
}
/*
* Macro for creating new Events
*/
#define gdcmEventMacro( classname , super ) \
\
class classname : public super { \
public: \
typedef classname Self; \
typedef super Superclass; \
classname() {} \
virtual ~classname() override = default; \
virtual const char * GetEventName() const override { return #classname; } \
virtual bool CheckEvent(const ::gdcm::Event* e) const override \
{ return dynamic_cast<const Self*>(e) ? true : false; } \
virtual ::gdcm::Event* MakeObject() const override \
{ return new Self; } \
classname(const Self&s) : super(s){} \
private: \
void operator=(const Self&); \
}
gdcmEventMacro( NoEvent , Event );
gdcmEventMacro( AnyEvent , Event );
gdcmEventMacro( StartEvent , AnyEvent );
gdcmEventMacro( EndEvent , AnyEvent );
//gdcmEventMacro( ProgressEvent , AnyEvent );
gdcmEventMacro( ExitEvent , AnyEvent );
gdcmEventMacro( AbortEvent , AnyEvent );
gdcmEventMacro( ModifiedEvent , AnyEvent );
gdcmEventMacro( InitializeEvent , AnyEvent );
gdcmEventMacro( IterationEvent , AnyEvent );
//gdcmEventMacro( AnonymizeEvent , AnyEvent );
gdcmEventMacro( UserEvent , AnyEvent );
} // end namespace gdcm
//-----------------------------------------------------------------------------
#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