[Insight-developers] Introducing itk::AutoPointer

Luis Ibanez luis . ibanez at kitware . com
Fri, 31 May 2002 11:38:22 -0400


Aljaz,

Great !,

Maybe we can fuse this two classes.

The only difference I can see in the
implementation of the itkFEMP is the
deep copy which seems to be the default
operation in construction and assignment.

The AutoPointer has as default action
to copy the raw pointer and release
the ownership in the original holder,
so it is more a transfer than a copy.

I have almost finished the modification
in my local checkout. The files involved are:

M Code/Common/itkCellBoundary.h
M Code/Common/itkCellBoundary.txx
M Code/Common/itkCellInterface.h
M Code/Common/itkCellInterface.txx
M Code/Common/itkHexahedronCell.h
M Code/Common/itkHexahedronCell.txx
M Code/Common/itkLineCell.h
M Code/Common/itkLineCell.txx
M Code/Common/itkMesh.h
M Code/Common/itkMesh.txx
M Code/Common/itkPolygonCell.h
M Code/Common/itkPolygonCell.txx
M Code/Common/itkQuadrilateralCell.h
M Code/Common/itkQuadrilateralCell.txx
M Code/Common/itkTetrahedronCell.h
M Code/Common/itkTetrahedronCell.txx
M Code/Common/itkTriangleCell.h
M Code/Common/itkTriangleCell.txx
M Code/Common/itkVertexCell.h
M Code/Common/itkVertexCell.txx
M Testing/Code/Common/CMakeLists.txt
M Testing/Code/Common/itkCommonTests.cxx
M Testing/Code/Common/itkMeshTest.cxx


Luis


================================================

Aljaz Noe wrote:

> There alerady is a similar thing in FEM code. It's called FEMP (file:
> itklFEMP.h). It basically does what you proposed. In addition to that,
> when the pointer is copied, the object that it's pointing to, is copied
> as well. FEM code uses it to store objects of polymorphic classes in stl
> containers.
> 
> Aljaz
> 
>