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

itkLightObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLightObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:29:14 $
00007   Version:   $Revision: 1.30 $
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      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkLightObject_h
00018 #define __itkLightObject_h
00019 
00020 #if defined(_MSC_VER)
00021 #pragma warning ( disable : 4786 )
00022 #endif
00023 
00024 #include <iostream>
00025 #include <typeinfo>
00026 
00027 #include "itkSmartPointer.h"
00028 #include "itkTimeStamp.h"
00029 #include "itkIndent.h"
00030 #include "itkSimpleFastMutexLock.h"
00031 
00032 #include "itkMacro.h"
00033 
00034 namespace itk
00035 {
00036   
00051 class ITKCommon_EXPORT LightObject 
00052 {
00053 public:
00055   typedef LightObject         Self;
00056   typedef SmartPointer<Self>  Pointer;
00057   typedef SmartPointer<const Self>  ConstPointer;
00058   
00060   static Pointer New();
00061 
00065   virtual void Delete();
00066 
00070   virtual const char *GetNameOfClass() const 
00071     {return "LightObject";}
00072 
00073 #ifdef _WIN32
00074 
00075   void* operator new(size_t);
00076   void* operator new[](size_t);
00077   void operator delete(void*);
00078   void operator delete[](void*, size_t);
00079 #endif 
00080   
00082   void Print(std::ostream& os) const;
00083 
00086   static void BreakOnError();
00087   
00089   virtual void Register() const;
00090 
00092   virtual void UnRegister() const;
00093 
00095   virtual int GetReferenceCount() const 
00096     {return m_ReferenceCount;}
00097 
00100   virtual void SetReferenceCount(int);
00101 
00102 protected:
00103   LightObject():m_ReferenceCount(1) {}
00104   virtual ~LightObject(); 
00105 
00110   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00111   virtual void PrintHeader(std::ostream& os, Indent indent) const;
00112   virtual void PrintTrailer(std::ostream& os, Indent indent) const;
00113   
00115   mutable int m_ReferenceCount;
00116 
00118   mutable SimpleFastMutexLock m_ReferenceCountLock;
00119 
00120 private:
00121   LightObject(const Self&); //purposely not implemented
00122   void operator=(const Self&); //purposely not implemented
00123   
00124   
00125 };
00126 
00127 } // end namespace itk
00128   
00129 #endif

Generated at Sun Jan 25 13:19:39 2004 for ITK by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-2000