TemplatevtkSmartPointer< T > class Reference

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

# vtkSmartPointer< T > Class Template Reference

`#include <vtkSmartPointer.h>`

Inheritance diagram for vtkSmartPointer< T >:

[legend]
Collaboration diagram for vtkSmartPointer< T >:

[legend]
List of all members.

## Detailed Description

### template<class T>
class vtkSmartPointer< T >

Hold a reference to a vtkObjectBase instance.

Date:
  2003/01/07 15:52:51

Revision:
  1.1

vtkSmartPointer is a class template that provides automatic casting for objects held by the vtkSmartPointerBase superclass.

Created by:
  - King, Brad

CVS contributions (if > 5%):
  - King, Brad (100%)

CVS logs (CVSweb):
  - .`h` (`/Common/vtkSmartPointer.h)`

Tests:
  vtkSmartPointer (Tests)

Definition at line 44 of file vtkSmartPointer.h.

## Public Methods
| vtkSmartPointer ()
| vtkSmartPointer (T *r)
| vtkSmartPointer (const vtkSmartPointerBase &r)
vtkSmartPointer & | operator= (T *r)
vtkSmartPointer & | operator= (const vtkSmartPointerBase &r)
T * | GetPointer () const
T & | operator * () const
T * | operator-> () const

## Constructor & Destructor Documentation

template<class T>
vtkSmartPointer< T >::vtkSmartPointer | ( |  | ) | `[inline]`

| Initialize smart pointer to NULL. Definition at line 48 of file vtkSmartPointer.h.

template<class T>
vtkSmartPointer< T >::vtkSmartPointer | ( | T * | r | ) | `[inline]`

| Initialize smart pointer to given object. Definition at line 51 of file vtkSmartPointer.h.

template<class T>
vtkSmartPointer< T >::vtkSmartPointer | ( | const vtkSmartPointerBase & | r | ) | `[inline]`

| Initialize smart pointer with a new reference to the same object referenced by given smart pointer. Definition at line 55 of file vtkSmartPointer.h.

## Member Function Documentation

template<class T>
vtkSmartPointer& vtkSmartPointer< T >::operator= | ( | T * | r | ) | `[inline]`

| Assign object to reference. This removes any reference to an old object. Definition at line 60 of file vtkSmartPointer.h. References vtkSmartPointerBase::operator=().

template<class T>
vtkSmartPointer& vtkSmartPointer< T >::operator= | ( | const vtkSmartPointerBase & | r | ) | `[inline]`

| Assign object to reference. This removes any reference to an old object. Reimplemented from vtkSmartPointerBase. Definition at line 70 of file vtkSmartPointer.h. References vtkSmartPointerBase::operator=().

template<class T>
T* vtkSmartPointer< T >::GetPointer | ( |  | ) | const`[inline]`

| Get the contained pointer. Reimplemented from vtkSmartPointerBase. Definition at line 79 of file vtkSmartPointer.h. References vtkSmartPointerBase::Object.

template<class T>
T& vtkSmartPointer< T >::operator * | ( |  | ) | const`[inline]`

| Dereference the pointer and return a reference to the contained object. Definition at line 88 of file vtkSmartPointer.h. References vtkSmartPointerBase::Object.

template<class T>
T* vtkSmartPointer< T >::operator-> | ( |  | ) | const`[inline]`

| Provides normal pointer target member access using operator->. Definition at line 96 of file vtkSmartPointer.h. References vtkSmartPointerBase::Object.

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

- Common/vtkSmartPointer.h