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: 2004/12/15 14:34:50 $
00007   Version:   $Revision: 1.42 $
00008 
00009   Copyright (c) Insight Software 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 #include "itkMetaDataDictionary.h"
00027 namespace itk
00028 {
00029 class SubjectImplementation;
00030 class Command;
00031 
00044 class ITKCommon_EXPORT Object: public LightObject
00045 {
00046 public:
00048   typedef Object              Self;
00049   typedef LightObject  Superclass;
00050   typedef SmartPointer<Self>  Pointer;
00051   typedef SmartPointer<const Self>  ConstPointer;
00052   
00054   static Pointer New();
00055 
00061   virtual LightObject::Pointer CreateAnother() const;
00062 
00064   itkTypeMacro(Object, LightObject);
00065 
00067   virtual void DebugOn() const;
00068 
00070   virtual void DebugOff() const;
00071   
00073   bool GetDebug() const;
00074   
00076   void SetDebug(bool debugFlag) const;
00077   
00079   virtual unsigned long GetMTime() const;
00080 
00083   virtual void Modified() const;
00084   
00086   virtual void Register() const;
00087 
00089   virtual void UnRegister() const;
00090 
00092   virtual void SetReferenceCount(int);
00093 
00096   static void SetGlobalWarningDisplay(bool flag);
00097   static bool GetGlobalWarningDisplay();
00098   static void GlobalWarningDisplayOn()
00099     { Object::SetGlobalWarningDisplay(true); }
00100   static void GlobalWarningDisplayOff()
00101     { Object::SetGlobalWarningDisplay(false); }
00102     
00111   unsigned long AddObserver(const EventObject & event, Command *);
00112   unsigned long AddObserver(const EventObject & event, Command *) const;
00113  
00119   Command* GetCommand(unsigned long tag);
00120 
00122   void InvokeEvent( const EventObject & );
00123 
00126   void InvokeEvent( const EventObject & ) const;
00127 
00129   void RemoveObserver(unsigned long tag);
00130 
00132   void RemoveAllObservers();
00133 
00135   bool HasObserver( const EventObject & event ) const;
00136 
00141   MetaDataDictionary & GetMetaDataDictionary(void);
00142 
00146   const MetaDataDictionary & GetMetaDataDictionary(void) const;
00147 
00151   void SetMetaDataDictionary(const MetaDataDictionary & rhs);
00152 
00153 
00154 protected:
00155   Object(); 
00156   virtual ~Object(); 
00157 
00162   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00163 
00164   bool PrintObservers(std::ostream& os, Indent indent) const;
00165 
00166 private:
00167   Object(const Self&); //purposely not implemented
00168   void operator=(const Self&); //purposely not implemented
00169 
00171   mutable bool m_Debug;
00172   
00174   mutable TimeStamp m_MTime;
00175   
00177   static bool m_GlobalWarningDisplay;
00178 
00181   SubjectImplementation* m_SubjectImplementation;
00189   mutable MetaDataDictionary * m_MetaDataDictionary;
00190 };
00191 
00192 } // end namespace itk
00193 
00194 #endif
00195 

Generated at Wed May 24 23:47:49 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000