# gdcmSimpleSubjectWatcher.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2009 Mathieu Malaterre
    00007   All rights reserved.
    00008   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 #ifndef __gdcmSimpleSubjectWatcher_h
    00016 #define __gdcmSimpleSubjectWatcher_h
    00017
    00018 #include "gdcmSubject.h"
    00019 #include "gdcmCommand.h"
    00020 #include "gdcmSmartPointer.h"
    00021 #include "gdcmAnonymizeEvent.h"
    00022
    00023 namespace gdcm
    00024 {
    00025 //-----------------------------------------------------------------------------
    00026 class Event;
    00031 class GDCM_EXPORT SimpleSubjectWatcher
    00032 {
    00033 public:
    00034   SimpleSubjectWatcher(Subject * s, const char *comment = "");
    00035   ~SimpleSubjectWatcher();
    00036
    00037 protected:
    00038   virtual void StartFilter();
    00039   virtual void EndFilter();
    00040   virtual void ShowProgress();
    00041   virtual void ShowIteration();
    00042   virtual void ShowAnonymization(Subject *caller, const Event &evt);
    00043   virtual void ShowAbort();
    00044
    00045 protected:
    00046   // Custom API used for internal Testing do not use !
    00047   void TestAbortOn();
    00048   void TestAbortOff();
    00049
    00050 private:
    00051   SmartPointer<gdcm::Subject> m_Subject;
    00052   std::string m_Comment;
    00053
    00054   typedef SimpleMemberCommand<SimpleSubjectWatcher> SimpleCommandType;
    00055   SmartPointer<SimpleCommandType> m_StartFilterCommand;
    00056   SmartPointer<SimpleCommandType> m_EndFilterCommand;
    00057   SmartPointer<SimpleCommandType> m_ProgressFilterCommand;
    00058   SmartPointer<SimpleCommandType> m_IterationFilterCommand;
    00059   SmartPointer<SimpleCommandType> m_AbortFilterCommand;
    00060
    00061   typedef MemberCommand<SimpleSubjectWatcher> CommandType;
    00062   SmartPointer<CommandType> m_AnonymizeFilterCommand;
    00063
    00064   unsigned long m_StartTag;
    00065   unsigned long m_EndTag;
    00066   unsigned long m_ProgressTag;
    00067   unsigned long m_IterationTag;
    00068   unsigned long m_AbortTag;
    00069   unsigned long m_AnonymizeTag;
    00070
    00071   bool m_TestAbort;
    00072
    00073   SimpleSubjectWatcher(const SimpleSubjectWatcher&);  // Not implemented.
    00074   void operator=(const SimpleSubjectWatcher&);  // Not implemented.
    00075 };
    00076 } // end namespace gdcm
    00077 //-----------------------------------------------------------------------------
    00078 #endif //__gdcmSimpleSubjectWatcher_h