vtk-dicom  0.8.17
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:
Inheritance graph
[legend]

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Friends

class vtkGarbageCollectorToObjectBaseFriendship
 
class vtkWeakPointerBaseToObjectBaseFriendship
 
VTKCOMMONCORE_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

Member Function Documentation

◆ Delete()

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.

◆ FastDelete()

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.

◆ GetClassName()

const char* vtkObjectBase::GetClassName ( ) const

Return the class name as a string.

◆ GetReferenceCount()

int vtkObjectBase::GetReferenceCount ( )
inline

Return the current reference count of this object.

◆ IsA()

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

◆ IsTypeOf()

static vtkTypeBool 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.

◆ New()

static vtkObjectBase* vtkObjectBase::New ( )
inlinestatic

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

◆ Print()

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.

◆ PrintRevisions()

void vtkObjectBase::PrintRevisions ( ostream &  )
inline

Legacy. Do not call.

◆ PrintSelf()

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

◆ Register()

virtual void vtkObjectBase::Register ( vtkObjectBase o)
virtual

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

Reimplemented in vtkAlgorithm.

◆ SetReferenceCount()

void vtkObjectBase::SetReferenceCount ( int  )

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

◆ UnRegister()

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 vtkAlgorithm.


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