Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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 =========================================================================*/
00057 #ifndef __vtkObjectBase_h
00058 #define __vtkObjectBase_h
00059 
00060 #include "vtkIndent.h"
00061 #include "vtkSystemIncludes.h"
00062 
00063 class VTK_COMMON_EXPORT vtkObjectBase 
00064 {
00065 public:
00069   virtual const char *GetClassName() const {return "vtkObjectBase";};
00070 
00074   static int IsTypeOf(const char *name);
00075 
00079   virtual int IsA(const char *name);
00080 
00084   virtual void Delete();
00085 
00087 
00089   static vtkObjectBase *New() 
00090     {return new vtkObjectBase;}
00092   
00093 #ifdef _WIN32
00094   // avoid dll boundary problems
00095   void* operator new( size_t tSize );
00096   void operator delete( void* p );
00097 #endif 
00098   
00101   void Print(ostream& os);
00102 
00104 
00108   virtual void PrintSelf(ostream& os, vtkIndent indent);
00109   virtual void PrintHeader(ostream& os, vtkIndent indent);
00110   virtual void PrintTrailer(ostream& os, vtkIndent indent);
00112 
00114   void Register(vtkObjectBase* o);
00115 
00119   virtual void UnRegister(vtkObjectBase* o);
00120 
00122 
00123   int  GetReferenceCount() 
00124     {return this->ReferenceCount;}
00126 
00128   void SetReferenceCount(int);
00129   
00136   void PrintRevisions(ostream& os);
00137   
00138 protected:
00139   vtkObjectBase(); 
00140   virtual ~vtkObjectBase(); 
00141 
00142   virtual void CollectRevisions(ostream& os);
00143   
00144   int ReferenceCount;      // Number of uses of this object by other objects
00145 
00146 private:
00147   //BTX
00148   friend VTK_COMMON_EXPORT ostream& operator<<(ostream& os, vtkObjectBase& o);
00149   //ETX
00150 
00151 protected:
00152 //BTX
00153   vtkObjectBase(const vtkObjectBase&) {}
00154   void operator=(const vtkObjectBase&) {}
00155 //ETX
00156 };
00157 
00158 #endif
00159