VTK
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkObjectBase Class Reference

abstract base class for most VTK objects More...

#include <vtkObjectBase.h>

Inheritance diagram for vtkObjectBase:
[legend]
Collaboration diagram for vtkObjectBase:
[legend]

Public Member Functions

const char * GetClassName () const
 
virtual int IsA (const char *name)
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &os)
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &os)
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Friends

class vtkGarbageCollectorToObjectBaseFriendship
 
class vtkWeakPointerBaseToObjectBaseFriendship
 
VTK_COMMON_EXPORT ostream & operator<< (ostream &os, vtkObjectBase &o)
 

Detailed Description

abstract base class for most VTK objects

vtkObjectBase is the base class for all reference counted classes in the VTK. These classes include vtkCommand classes, vtkInformationKey classes, and vtkObject classes.

vtkObjectBase performs reference counting: objects that are reference counted exist as long as another object uses them. Once the last reference to a reference counted object is removed, the object will spontaneously destruct.

Constructor and destructor of the subclasses of vtkObjectBase should be protected, so that only New() and UnRegister() actually call them. Debug leaks can be used to see if there are any objects left with nonzero reference count.

Warning
Note: Objects of subclasses of vtkObjectBase should always be created with the New() method and deleted with the Delete() method. They cannot be allocated off the stack (i.e., automatic objects) because the constructor is a protected method.
See Also
vtkObject vtkCommand vtkInformationKey
Examples:
vtkObjectBase (Examples)
Tests:
vtkObjectBase (Tests)

Definition at line 59 of file vtkObjectBase.h.

Constructor & Destructor Documentation

vtkObjectBase::vtkObjectBase ( )
protected
virtual vtkObjectBase::~vtkObjectBase ( )
protectedvirtual
vtkObjectBase::vtkObjectBase ( const vtkObjectBase )
inlineprotected

Definition at line 185 of file vtkObjectBase.h.

Member Function Documentation

const char* vtkObjectBase::GetClassName ( ) const

Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeMacro found in vtkSetGet.h.

static int vtkObjectBase::IsTypeOf ( const char *  name)
static

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

virtual int vtkObjectBase::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented in vtkCommand, vtkConditionVariable, vtkFunctionParser, vtkObjectFactory, vtkOrderedTriangulator, vtkCriticalSection, vtkGarbageCollector, vtkMultiThreader, vtkTimerLog, vtkMutexLock, vtkInformation, vtkFastNumericConversion, vtkTypeTemplate< vtkSparseArray< T >, vtkTypedArray< T > >, vtkTypeTemplate< vtkTypedArray< T >, vtkArray >, vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > >, vtkInstantiator, vtkArray, vtkMath, vtkExecutionScheduler, vtkObject, vtkParametricFunction, vtkAlgorithm, vtkFieldData, vtkImplicitSelectionLoop, vtkLocator, vtkSpline, vtkAbstractArray, vtkTransform, vtkDataSetAttributes, vtkPolynomialSolversUnivariate, vtkPriorityQueue, vtkAssemblyNode, vtkImplicitFunction, vtkPerspectiveTransform, vtkVariantArray, vtkContext2D, vtkLookupTable, vtkPropAssembly, vtkUndirectedGraphAlgorithm, vtkDataArray, vtkPlanes, vtkTreeAlgorithm, vtkHeap, vtkCollection, vtkMatrix4x4, vtkParametricSuperToroid, vtkCellTypes, vtkProcessObject, vtkPlot, vtkAbstractMapper, vtkDataSetAlgorithm, vtkOutEdgeIterator, vtkAbstractTransform, vtkProp, vtkHyperOctreeCursor, vtkImplicitDataSet, vtkPolyDataAlgorithm, vtkSimpleScalarTree, vtkAnimationCue, vtkCallbackCommand, vtkAbstractCellLocator, vtkCellArray, vtkPlotPoints, vtkArrayIterator, vtkParametricFigure8Klein, vtkParametricKlein, vtkParametricSuperEllipsoid, vtkImplicitVolume, vtkInEdgeIterator, vtkChart, vtkChartXY, vtkContextScene, vtkMatrix3x3, vtkMinimalStandardRandomSequence, vtkTransform2D, vtkStructuredGridAlgorithm, vtkOutputWindow, vtkXMLFileOutputWindow, vtkScalarTree, vtkViewport, vtkAxis, vtkOpenGLContextDevice2D, vtkDoubleArray, vtkFloatArray, vtkIdTypeArray, vtkIntArray, vtkLookupTableWithEnabling, vtkQuadratureSchemeDefinition, vtkStringArray, vtkStructuredData, vtkUnsignedCharArray, vtkActor2D, vtkCellLinks, vtkOctreePointLocatorNode, vtkPointSetAlgorithm, vtkTreeBFSIterator, vtkContextDevice2D, vtkDebugLeaks, vtkParametricEllipsoid, vtkPoints, vtkSphericalTransform, vtkBSPIntersections, vtkAbstractContextBufferId, vtkOpenGL2ContextDevice2D, vtkPlotStacked, vtkAnimationScene, vtkRungeKutta45, vtkScalarsToColors, vtkUnicodeStringArray, vtkGenericEdgeTable, vtkPlotBar, vtkCharArray, vtkEdgeTable, vtkLongArray, vtkParametricBoy, vtkParametricCrossCap, vtkParametricDini, vtkParametricEnneper, vtkParametricRandomHills, vtkShortArray, vtkSignedCharArray, vtkUnsignedIntArray, vtkUnsignedLongArray, vtkUnsignedShortArray, vtkVersion, vtkWindowLevelLookupTable, vtkImplicitSum, vtkChartLegend, vtkPiecewiseControlPointsItem, vtkGeneralTransform, vtkInformationVector, vtkPropCollection, vtkSortDataArray, vtkImplicitWindowFunction, vtkCompositeControlPointsItem, vtkAssemblyPath, vtkBox, vtkCylindricalTransform, vtkMatrixToHomogeneousTransform, vtkMatrixToLinearTransform, vtkOldStyleCallbackCommand, vtkParametricConicSpiral, vtkParametricRoman, vtkParametricTorus, vtkPoints2D, vtkRungeKutta4, vtkControlPointsItem, vtkScalarsToColorsItem, vtk__Int64Array, vtkIdList, vtkInitialValueProblemSolver, vtkLongLongArray, vtkParametricMobius, vtkPlane, vtkProperty2D, vtkUnsigned__Int64Array, vtkUnsignedLongLongArray, vtkAlgorithmOutput, vtkImageToStructuredPoints, vtkAbstractContextItem, vtkColorTransferControlPointsItem, vtkPen, vtkPlotParallelCoordinates, vtkPlotPie, vtkTooltipItem, vtkAmoebaMinimizer, vtkDirectory, vtkDynamicLoader, vtkStructuredVisibilityConstraint, vtkWin32OutputWindow, vtkPointData, vtkChartParallelCoordinates, vtkContextTransform, vtkPlotGrid, vtkAssemblyPaths, vtkContourValues, vtkInformationIterator, vtkInformationKey, vtkRandomSequence, vtkTimePointUtility, vtkDataObjectCollection, vtkBlockItem, vtkBrush, vtkChartPie, vtkColorLegend, vtkColorSeries, vtkContextActor, vtkContextMapper2D, vtkImageItem, vtkBitArray, vtkCollectionIterator, vtkExtentSplitter, vtkExtentTranslator, vtkIdentityTransform, vtkLogLookupTable, vtkWindow, vtkDataObjectTypes, vtkImageAlgorithm, vtkSphere, vtkChartHistogram2D, vtkInformationQuadratureSchemeDefinitionVectorKey, vtkOverrideInformation, vtkOverrideInformationCollection, vtkPlaneCollection, vtkQuadric, vtkTensor, vtkXMLDataElement, vtkPlotHistogram2D, vtkFunctionSet, vtkHomogeneousTransform, vtkRungeKutta2, vtkThreadMessager, vtkTransformCollection, vtkHyperOctreePointsGrabber, vtkMapper2D, vtkTrivialProducer, vtkContextItem, vtkOpenGLContextBufferId, vtkByteSwap, vtkDataArraySelection, vtkEventForwarderCommand, vtkFileOutputWindow, vtkInformationObjectBaseVectorKey, vtkObjectFactoryCollection, vtkWin32ProcessOutputWindow, vtkImageInPlaceFilter, vtkContextBufferId, vtkContextClip, vtkDataArrayCollectionIterator, vtkImplicitFunctionCollection, vtkInformationDataObjectKey, vtkInformationInformationVectorKey, vtkInformationObjectBaseKey, vtkStructuredExtent, vtkVoidArray, vtkHierarchicalBoxDataSetAlgorithm, vtkMultiBlockDataSetAlgorithm, vtkTemporalDataSetAlgorithm, vtkBoxMuellerRandomSequence, vtkDataArrayCollection, vtkIdListCollection, vtkLinearTransform, vtkReferenceCount, vtkSocketCollection, vtkTableExtentTranslator, vtkWarpTransform, vtkDataSetCollection, vtkStructuredPointsCollection, vtkPlotLine, vtkGaussianRandomSequence, vtkInformationDoubleKey, vtkInformationDoubleVectorKey, vtkInformationIdTypeKey, vtkInformationInformationKey, vtkInformationIntegerKey, vtkInformationIntegerPointerKey, vtkInformationIntegerVectorKey, vtkInformationKeyVectorKey, vtkInformationRequestKey, vtkInformationStringKey, vtkInformationStringVectorKey, vtkInformationUnsignedLongKey, vtkOnePieceExtentTranslator, vtkColorTransferFunctionItem, vtkBitArrayIterator, vtkProcessStatistics, vtkServerSocket, vtkSocket, vtkLookupTableItem, vtkCompositeTransferFunctionItem, vtkPiecewiseFunctionItem, vtkClientSocket, and vtkPythonCommand.

virtual void vtkObjectBase::Delete ( )
virtual

Delete a VTK object. This method should always be used to delete an object when the New() method was used to create it. Using the C++ delete method will not work with reference counting.

virtual void vtkObjectBase::FastDelete ( )
virtual

Delete a reference to this object. This version will not invoke garbage collection and can potentially leak the object if it is part of a reference loop. Use this method only when it is known that the object has another reference and would not be collected if a full garbage collection check were done.

static vtkObjectBase* vtkObjectBase::New ( )
inlinestatic

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Definition at line 110 of file vtkObjectBase.h.

void vtkObjectBase::Print ( ostream &  os)

Print an object to an ostream. This is the method to call when you wish to see print the internal state of an object.

virtual void vtkObjectBase::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented in vtkConditionVariable, vtkFunctionParser, vtkObjectFactory, vtkOrderedTriangulator, vtkCriticalSection, vtkObject, vtkGarbageCollector, vtkMultiThreader, vtkTimerLog, vtkMutexLock, vtkInformation, vtkSparseArray< T >, vtkFastNumericConversion, vtkTypedArray< T >, vtkInstantiator, vtkArray, vtkMath, vtkExecutionScheduler, vtkDenseArray< T >, vtkParametricFunction, vtkAlgorithm, vtkFieldData, vtkImplicitSelectionLoop, vtkLocator, vtkSpline, vtkAbstractArray, vtkTransform, vtkDataSetAttributes, vtkPolynomialSolversUnivariate, vtkPriorityQueue, vtkAssemblyNode, vtkImplicitFunction, vtkPerspectiveTransform, vtkVariantArray, vtkContext2D, vtkLookupTable, vtkPropAssembly, vtkUndirectedGraphAlgorithm, vtkDataArray, vtkPlanes, vtkTreeAlgorithm, vtkHeap, vtkCollection, vtkMatrix4x4, vtkParametricSuperToroid, vtkCellTypes, vtkPlanesIntersection, vtkProcessObject, vtkPlot, vtkAbstractMapper, vtkDataSetAlgorithm, vtkOutEdgeIterator, vtkAbstractTransform, vtkProp, vtkHyperOctreeCursor, vtkImplicitDataSet, vtkPolyDataAlgorithm, vtkSimpleScalarTree, vtkAnimationCue, vtkAbstractCellLocator, vtkCellArray, vtkPlotPoints, vtkArrayIterator, vtkParametricFigure8Klein, vtkParametricKlein, vtkParametricSuperEllipsoid, vtkImplicitVolume, vtkInEdgeIterator, vtkChart, vtkChartXY, vtkContextScene, vtkMatrix3x3, vtkMinimalStandardRandomSequence, vtkOutputWindow, vtkTransform2D, vtkStructuredGridAlgorithm, vtkScalarTree, vtkViewport, vtkAxis, vtkOpenGLContextDevice2D, vtkDoubleArray, vtkFloatArray, vtkIdTypeArray, vtkIntArray, vtkLookupTableWithEnabling, vtkQuadratureSchemeDefinition, vtkStringArray, vtkUnsignedCharArray, vtkCellLinks, vtkOctreePointLocatorNode, vtkPointSetAlgorithm, vtkTreeBFSIterator, vtkContextDevice2D, vtkDirectory, vtkParametricEllipsoid, vtkPoints, vtkSphericalTransform, vtkBSPIntersections, vtkAbstractContextBufferId, vtkOpenGL2ContextDevice2D, vtkPlotStacked, vtkAnimationScene, vtkRungeKutta45, vtkScalarsToColors, vtkUnicodeStringArray, vtkActor2D, vtkGenericEdgeTable, vtkPlotBar, vtkCharArray, vtkEdgeTable, vtkLongArray, vtkParametricBoy, vtkParametricCrossCap, vtkParametricDini, vtkParametricEnneper, vtkParametricRandomHills, vtkShortArray, vtkSignedCharArray, vtkSortDataArray, vtkUnsignedIntArray, vtkUnsignedLongArray, vtkUnsignedShortArray, vtkWindowLevelLookupTable, vtkImplicitSum, vtkChartLegend, vtkPiecewiseControlPointsItem, vtkArrayIteratorTemplate< T >, vtkGeneralTransform, vtkInformationVector, vtkImplicitWindowFunction, vtkCompositeControlPointsItem, vtkAssemblyPath, vtkBox, vtkCylindricalTransform, vtkMatrixToHomogeneousTransform, vtkMatrixToLinearTransform, vtkParametricConicSpiral, vtkParametricRoman, vtkParametricTorus, vtkPoints2D, vtkRungeKutta4, vtkControlPointsItem, vtkScalarsToColorsItem, vtk__Int64Array, vtkIdList, vtkInitialValueProblemSolver, vtkLongLongArray, vtkParametricMobius, vtkPlane, vtkProperty2D, vtkUnsigned__Int64Array, vtkUnsignedLongLongArray, vtkAlgorithmOutput, vtkImageToStructuredPoints, vtkAbstractContextItem, vtkColorTransferControlPointsItem, vtkPen, vtkPlotParallelCoordinates, vtkPlotPie, vtkTooltipItem, vtkAmoebaMinimizer, vtkStructuredVisibilityConstraint, vtkWin32OutputWindow, vtkPointData, vtkPointsProjectedHull, vtkChartParallelCoordinates, vtkContextTransform, vtkPlotGrid, vtkContourValues, vtkInformationIterator, vtkInformationKey, vtkRandomSequence, vtkTimePointUtility, vtkBlockItem, vtkBrush, vtkChartPie, vtkColorLegend, vtkColorSeries, vtkContextMapper2D, vtkImageItem, vtkBitArray, vtkCollectionIterator, vtkExtentSplitter, vtkExtentTranslator, vtkFileOutputWindow, vtkIdentityTransform, vtkLogLookupTable, vtkOverrideInformation, vtkWindow, vtkDataObjectTypes, vtkImageAlgorithm, vtkSphere, vtkChartHistogram2D, vtkInformationQuadratureSchemeDefinitionVectorKey, vtkQuadric, vtkTensor, vtkXMLDataElement, vtkContextActor, vtkPlotHistogram2D, vtkFunctionSet, vtkHomogeneousTransform, vtkThreadMessager, vtkWin32ProcessOutputWindow, vtkHyperOctreePointsGrabber, vtkMapper2D, vtkTrivialProducer, vtkContextItem, vtkOpenGLContextBufferId, vtkDataArraySelection, vtkDataArrayTemplate< T >, vtkInformationObjectBaseVectorKey, vtkImageInPlaceFilter, vtkContextBufferId, vtkContextClip, vtkDataArrayCollectionIterator, vtkInformationDataObjectKey, vtkInformationInformationVectorKey, vtkInformationObjectBaseKey, vtkStructuredExtent, vtkVoidArray, vtkHierarchicalBoxDataSetAlgorithm, vtkMultiBlockDataSetAlgorithm, vtkTemporalDataSetAlgorithm, vtkBoxMuellerRandomSequence, vtkLinearTransform, vtkReferenceCount, vtkSocketCollection, vtkTableExtentTranslator, vtkWarpTransform, vtkStructuredPointsCollection, vtkPlotLine, vtkGaussianRandomSequence, vtkInformationDoubleKey, vtkInformationDoubleVectorKey, vtkInformationIdTypeKey, vtkInformationInformationKey, vtkInformationIntegerKey, vtkInformationIntegerPointerKey, vtkInformationIntegerVectorKey, vtkInformationKeyVectorKey, vtkInformationRequestKey, vtkInformationStringKey, vtkInformationStringVectorKey, vtkInformationUnsignedLongKey, vtkOnePieceExtentTranslator, vtkColorTransferFunctionItem, vtkBitArrayIterator, vtkServerSocket, vtkSocket, vtkLookupTableItem, vtkCompositeTransferFunctionItem, vtkPiecewiseFunctionItem, and vtkClientSocket.

virtual void vtkObjectBase::PrintHeader ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

virtual void vtkObjectBase::PrintTrailer ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

virtual void vtkObjectBase::Register ( vtkObjectBase o)
virtual

Increase the reference count (mark as used by another object).

Reimplemented in vtkInformation, vtkAlgorithm, vtkLocator, vtkCollection, vtkImplicitWindowFunction, vtkInformationVector, and vtkInformationKey.

virtual void vtkObjectBase::UnRegister ( vtkObjectBase o)
virtual

Decrease the reference count (release by another object). This has the same effect as invoking Delete() (i.e., it reduces the reference count by 1).

Reimplemented in vtkInformation, vtkAbstractTransform, vtkCommand, vtkAlgorithm, vtkLocator, vtkCollection, vtkImplicitWindowFunction, vtkInformationVector, and vtkInformationKey.

int vtkObjectBase::GetReferenceCount ( )
inline

Return the current reference count of this object.

Definition at line 144 of file vtkObjectBase.h.

void vtkObjectBase::SetReferenceCount ( int  )

Sets the reference count. (This is very dangerous, use with care.)

void vtkObjectBase::PrintRevisions ( ostream &  os)

Prints a list of the class .cxx file CVS revisions for all classes in the object's inheritance chain. The format of the list is "vtkObjectBase 1.4\n" with one class per line. The list always starts with the least-derived class (vtkObjectBase), and ends with the most-derived class. This is useful for programs wishing to do serialization of VTK objects.

virtual void vtkObjectBase::CollectRevisions ( ostream &  os)
protectedvirtual
virtual void vtkObjectBase::RegisterInternal ( vtkObjectBase ,
int  check 
)
protectedvirtual

Reimplemented in vtkObject.

virtual void vtkObjectBase::UnRegisterInternal ( vtkObjectBase ,
int  check 
)
protectedvirtual

Reimplemented in vtkObject.

virtual void vtkObjectBase::ReportReferences ( vtkGarbageCollector )
protectedvirtual
void vtkObjectBase::operator= ( const vtkObjectBase )
inlineprotected

Definition at line 186 of file vtkObjectBase.h.

Friends And Related Function Documentation

friend class vtkGarbageCollectorToObjectBaseFriendship
friend

Definition at line 180 of file vtkObjectBase.h.

friend class vtkWeakPointerBaseToObjectBaseFriendship
friend

Definition at line 181 of file vtkObjectBase.h.

VTK_COMMON_EXPORT ostream& operator<< ( ostream &  os,
vtkObjectBase o 
)
friend

Member Data Documentation

int vtkObjectBase::ReferenceCount
protected

Definition at line 165 of file vtkObjectBase.h.

vtkWeakPointerBase** vtkObjectBase::WeakPointers
protected

Definition at line 166 of file vtkObjectBase.h.


The documentation for this class was generated from the following file: