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: 2004/11/01 21:09:18 $
00007   Version:   $Revision: 1.32 $
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 
00067   virtual Pointer CreateAnother() const;
00068 
00072   virtual void Delete();
00073 
00077   virtual const char *GetNameOfClass() const 
00078     {return "LightObject";}
00079 
00080 #ifdef _WIN32
00081 
00082   void* operator new(size_t);
00083   void* operator new[](size_t);
00084   void operator delete(void*);
00085   void operator delete[](void*, size_t);
00086 #endif 
00087   
00089   void Print(std::ostream& os, Indent indent=0) const;
00090 
00093   static void BreakOnError();
00094   
00096   virtual void Register() const;
00097 
00099   virtual void UnRegister() const;
00100 
00102   virtual int GetReferenceCount() const 
00103     {return m_ReferenceCount;}
00104 
00107   virtual void SetReferenceCount(int);
00108 
00109 protected:
00110   LightObject():m_ReferenceCount(1) {}
00111   virtual ~LightObject(); 
00112 
00117   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00118   virtual void PrintHeader(std::ostream& os, Indent indent) const;
00119   virtual void PrintTrailer(std::ostream& os, Indent indent) const;
00120   
00122   mutable int m_ReferenceCount;
00123 
00125   mutable SimpleFastMutexLock m_ReferenceCountLock;
00126 
00127 private:
00128   LightObject(const Self&); //purposely not implemented
00129   void operator=(const Self&); //purposely not implemented
00130   
00131   
00132 };
00133 
00134 } // end namespace itk
00135   
00136 #endif

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