# gdcmSubject.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-2010 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 GDCMSUBJECT_H
    00016 #define GDCMSUBJECT_H
    00017
    00018 #include "gdcmObject.h"
    00019
    00020 namespace gdcm
    00021 {
    00022 class Event;
    00023 class Command;
    00024 class SubjectInternals;
    00029 class GDCM_EXPORT Subject : public Object
    00030 {
    00031 public:
    00032   Subject();
    00033   ~Subject();
    00034
    00043   unsigned long AddObserver(const Event & event, Command *);
    00044   unsigned long AddObserver(const Event & event, Command *) const;
    00045
    00051   Command* GetCommand(unsigned long tag);
    00052
    00054   void InvokeEvent( const Event & );
    00055
    00058   void InvokeEvent( const Event & ) const;
    00059
    00061   void RemoveObserver(unsigned long tag);
    00062
    00064   void RemoveAllObservers();
    00065
    00067   bool HasObserver( const Event & event ) const;
    00068
    00069 protected:
    00070
    00071 private:
    00072   SubjectInternals *Internals;
    00073 private:
    00074 };
    00075
    00076 } // end namespace gdcm
    00077
    00078 #endif //GDCMSUBJECT_H
    00079