Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Common/vtkObjectBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkObjectBase.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00046 #ifndef __vtkObjectBase_h
00047 #define __vtkObjectBase_h
00048 
00049 #include "vtkIndent.h"
00050 #include "vtkSystemIncludes.h"
00051 
00052 class VTK_COMMON_EXPORT vtkObjectBase 
00053 {
00054 public:
00058   virtual const char *GetClassName() const {return "vtkObjectBase";};
00059 
00063   static int IsTypeOf(const char *name);
00064 
00068   virtual int IsA(const char *name);
00069 
00073   virtual void Delete();
00074 
00076 
00078   static vtkObjectBase *New() 
00079     {return new vtkObjectBase;}
00081   
00082 #ifdef _WIN32
00083   // avoid dll boundary problems
00084   void* operator new( size_t tSize );
00085   void operator delete( void* p );
00086 #endif 
00087   
00090   void Print(ostream& os);
00091 
00093 
00097   virtual void PrintSelf(ostream& os, vtkIndent indent);
00098   virtual void PrintHeader(ostream& os, vtkIndent indent);
00099   virtual void PrintTrailer(ostream& os, vtkIndent indent);
00101 
00103   void Register(vtkObjectBase* o);
00104 
00108   virtual void UnRegister(vtkObjectBase* o);
00109 
00111 
00112   int  GetReferenceCount() 
00113     {return this->ReferenceCount;}
00115 
00117   void SetReferenceCount(int);
00118   
00125   void PrintRevisions(ostream& os);
00126   
00127 protected:
00128   vtkObjectBase(); 
00129   virtual ~vtkObjectBase(); 
00130 
00131   virtual void CollectRevisions(ostream& os);
00132   
00133   int ReferenceCount;      // Number of uses of this object by other objects
00134 
00135 private:
00136   //BTX
00137   friend VTK_COMMON_EXPORT ostream& operator<<(ostream& os, vtkObjectBase& o);
00138   //ETX
00139 
00140 protected:
00141 //BTX
00142   vtkObjectBase(const vtkObjectBase&) {}
00143   void operator=(const vtkObjectBase&) {}
00144 //ETX
00145 };
00146 
00147 #endif
00148