KWStyle - itkAutoPointerDataObjectDecorator.txx
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkAutoPointerDataObjectDecorator.txx.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:33 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12   Portions of this code are covered under the VTK copyright.
13   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14
15      This software is distributed WITHOUT ANY WARRANTY; without even 
16      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
17 IND *****PURPOSE.  See the above copyright notices for more information.
18
19 =========================================================================*/
20 DEF #ifndef _itkAutoPointerDataObjectDecorator_txx
21 DEF #define _itkAutoPointerDataObjectDecorator_txx
22
23 #include "itkAutoPointerDataObjectDecorator.h"
24
25 namespace itk
26 {
27
28 /**
29  *
30  */
31 template<class T>
32 AutoPointerDataObjectDecorator<T>
33 ::AutoPointerDataObjectDecorator() : m_Component()
34 {
35 }
36
37
38 /**
39  *
40  */
41 template<class T>
42 AutoPointerDataObjectDecorator<T>
43 ::~AutoPointerDataObjectDecorator()
44 {
45 }
46
47
48 /**
49  *
50  */
51 template<class T>
52 void
53 AutoPointerDataObjectDecorator<T>
54 ::Set(T* val)
55 {
56   if (m_Component.get() != val)
57     {
58     // store the pointer and take ownership of the memory
59     ComponentPointer aPointer(val);
60     m_Component = aPointer;
61     this->Modified();
62     }
63 }
64
65
66 /**
67  *
68  */
69 template<class T>
70 void 
71 AutoPointerDataObjectDecorator<T>
72 ::PrintSelf(std::ostream& os, Indent indent) const
73 {
74   Superclass::PrintSelf(os,indent);
75
76   os << indent << "Component: " << typeid(m_Component).name() << std::endl;
77 }
78
79 // end namespace itk
80
81 #endif
82

Generated by KWStyle 1.0b on Tuesday January,17 at 02:13:59PM
© Kitware Inc.