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: 2006-05-10 20:27:16 $
00007   Version:   $Revision: 1.44 $
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 #include "itkMetaDataDictionary.h"
00026 
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); }
00103 
00112   unsigned long AddObserver(const EventObject & event, Command *);
00113   unsigned long AddObserver(const EventObject & event, Command *) const;
00115 
00121   Command* GetCommand(unsigned long tag);
00122 
00124   void InvokeEvent( const EventObject & );
00125 
00128   void InvokeEvent( const EventObject & ) const;
00129 
00131   void RemoveObserver(unsigned long tag);
00132 
00134   void RemoveAllObservers();
00135 
00137   bool HasObserver( const EventObject & event ) const;
00138 
00143   MetaDataDictionary & GetMetaDataDictionary(void);
00144 
00148   const MetaDataDictionary & GetMetaDataDictionary(void) const;
00149 
00153   void SetMetaDataDictionary(const MetaDataDictionary & rhs);
00154 
00155 
00156 protected:
00157   Object(); 
00158   virtual ~Object(); 
00159 
00164   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00165 
00166   bool PrintObservers(std::ostream& os, Indent indent) const;
00167 
00168 private:
00169   Object(const Self&); //purposely not implemented
00170   void operator=(const Self&); //purposely not implemented
00171 
00173   mutable bool m_Debug;
00174 
00176   mutable TimeStamp m_MTime;
00177 
00179   static bool m_GlobalWarningDisplay;
00180 
00183   SubjectImplementation* m_SubjectImplementation;
00184 
00192   mutable MetaDataDictionary * m_MetaDataDictionary;
00193 };
00194 
00195 } // end namespace itk
00196 
00197 #endif
00198 
00199 

Generated at Mon Apr 14 13:49:44 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000