Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/04/23 22:23:16 $
00007   Version:   $Revision: 1.33 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkObject_h
00021 #define __itkObject_h
00022 
00023 #include "itkLightObject.h"
00024 #include "itkEventObject.h"
00025 
00026 namespace itk
00027 {
00028 class SubjectImplementation;
00029 class Command;
00030 
00043 class ITK_EXPORT Object: public LightObject
00044 {
00045 public:
00047   typedef Object              Self;
00048   typedef LightObject  Superclass;
00049   typedef SmartPointer<Self>  Pointer;
00050   typedef SmartPointer<const Self>  ConstPointer;
00051   
00053   static Pointer New();
00054 
00056   itkTypeMacro(Object, LightObject);
00057 
00059   virtual void DebugOn() const;
00060 
00062   virtual void DebugOff() const;
00063   
00065   bool GetDebug() const;
00066   
00068   void SetDebug(bool debugFlag) const;
00069   
00071   virtual unsigned long GetMTime() const;
00072 
00075   virtual void Modified() const;
00076   
00078   virtual void Register() const;
00079 
00081   virtual void UnRegister() const;
00082 
00084   virtual void SetReferenceCount(int);
00085 
00088   static void SetGlobalWarningDisplay(bool flag);
00089   static bool GetGlobalWarningDisplay();
00090   static void GlobalWarningDisplayOn()
00091     { Object::SetGlobalWarningDisplay(true); }
00092   static void GlobalWarningDisplayOff()
00093     { Object::SetGlobalWarningDisplay(false); }
00094     
00103   unsigned long AddObserver(const EventObject & event, Command *);
00104  
00110   Command* GetCommand(unsigned long tag);
00111 
00113   void InvokeEvent( const EventObject & );
00114 
00117   void InvokeEvent( const EventObject & ) const;
00118 
00120   void RemoveObserver(unsigned long tag);
00121 
00123   bool HasObserver( const EventObject & event ) const;
00124   
00125 protected:
00126   Object(); 
00127   virtual ~Object(); 
00128 
00133   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00134 
00135   bool PrintObservers(std::ostream& os, Indent indent) const;
00136 
00137 private:
00138   Object(const Self&); //purposely not implemented
00139   void operator=(const Self&); //purposely not implemented
00140 
00142   mutable bool m_Debug;
00143   
00145   mutable TimeStamp m_MTime;
00146   
00148   static bool m_GlobalWarningDisplay;
00149 
00152   SubjectImplementation* m_SubjectImplementation;
00153 };
00154   
00155 } // end namespace itk
00156 
00157 #endif
00158 

Generated at Fri May 21 01:15:09 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000