ALBA
vtkALBASmartPointer.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: vtkALBASmartPointer
5 Authors: Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __vtkALBASmartPointer_h
17#define __vtkALBASmartPointer_h
18
19#include "albaConfigure.h"
20#include "vtkSmartPointer.h"
21
26template <class T>
27class vtkALBAAutoPointer: public vtkSmartPointer<T>
28{
29public:
31 vtkALBAAutoPointer():vtkSmartPointer<T>() {}
32
35 vtkALBAAutoPointer(T* r): vtkSmartPointer<T>(r) {}
36
40 vtkALBAAutoPointer(const vtkSmartPointerBase& r): vtkSmartPointer<T>(r) {}
43 operator T *() const {return (T *)this->Object;}
44};
45
46template <class T>
48{
49public:
52 vtkALBASmartPointer() {this->Object=T::New();}
53
57
61 vtkALBASmartPointer(const vtkSmartPointerBase& r): vtkSmartPointerBase(r) {}
62};
63
64#endif
Hold a reference to a vtkObjectBase instance.
vtkALBAAutoPointer(T *r)
Initialize smart pointer to given object pointer and reference the given object.
vtkALBAAutoPointer(const vtkSmartPointerBase &r)
Initialize smart pointer with a new reference to the same object referenced by given smart pointer.
vtkALBAAutoPointer()
Initialize smart pointer to a new instanse of class T.
vtkALBASmartPointer(const vtkSmartPointerBase &r)
Initialize smart pointer with a new reference to the same object referenced by given smart pointer.
vtkALBASmartPointer()
Initialize smart pointer to a new instanse of class T.
vtkALBASmartPointer(T *r)
Initialize smart pointer to given object pointer and reference the given object.