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: 2002/02/26 20:58:01 $
00007   Version:   $Revision: 1.27 $
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      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 
00021 
00022 #include <iostream>
00023 #include <typeinfo>
00024 
00025 #include "itkSmartPointer.h"
00026 #include "itkTimeStamp.h"
00027 #include "itkIndent.h"
00028 #include "itkSimpleFastMutexLock.h"
00029 
00030 #include "itkMacro.h"
00031 
00032 namespace itk
00033 {
00034   
00049 class ITK_EXPORT LightObject 
00050 {
00051 public:
00053   typedef LightObject         Self;
00054   typedef SmartPointer<Self>  Pointer;
00055   typedef SmartPointer<const Self>  ConstPointer;
00056   
00058   static Pointer New();
00059 
00063   virtual void Delete();
00064 
00068   virtual const char *GetNameOfClass() const 
00069     {return "LightObject";}
00070 
00071 #ifdef _WIN32
00072 
00073   void* operator new(size_t);
00074   void* operator new[](size_t);
00075   void operator delete(void*);
00076   void operator delete[](void*, size_t);
00077 #endif 
00078   
00080   void Print(std::ostream& os) const;
00081 
00084   static void BreakOnError();
00085   
00087   virtual void Register() const;
00088 
00090   virtual void UnRegister() const;
00091 
00093   virtual int GetReferenceCount() const 
00094     {return m_ReferenceCount;}
00095 
00098   virtual void SetReferenceCount(int);
00099 
00100 protected:
00101   LightObject():m_ReferenceCount(1) {}
00102   virtual ~LightObject(); 
00103 
00108   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00109   virtual void PrintHeader(std::ostream& os, Indent indent) const;
00110   virtual void PrintTrailer(std::ostream& os, Indent indent) const;
00111   
00113   mutable int m_ReferenceCount;
00114 
00116   mutable SimpleFastMutexLock m_ReferenceCountLock;
00117 
00118 private:
00119   LightObject(const Self&); //purposely not implemented
00120   void operator=(const Self&); //purposely not implemented
00121   
00122   
00123 };
00124 
00125 } // end namespace itk
00126   
00127 #endif

Generated at Wed Mar 12 01:13:04 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000