Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkSTLContainerAdaptor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSTLContainerAdaptor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-03-03 15:09:06 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkSTLContainerAdaptor_h
00018 #define __itkSTLContainerAdaptor_h
00019 
00020 
00021 namespace itk {
00022 
00023 
00035 template<typename TContainer>
00036 class STLContainerAdaptor
00037 {
00038 public:
00039 
00040   typedef TContainer                      AdapteeType;
00041 
00042   typedef typename AdapteeType::Element            ElementType;
00043   typedef typename AdapteeType::STLContainerType   TargetType;
00044   
00045 private:
00046 
00047   AdapteeType & m_AdapteeRef;
00048   
00050   STLContainerAdaptor(const STLContainerAdaptor & r);
00051 
00052   /* hide and avoid operator= */
00053   const STLContainerAdaptor & operator=(const STLContainerAdaptor & r);
00054   
00055   
00056 public:
00057   STLContainerAdaptor(AdapteeType & adaptee) : m_AdapteeRef(adaptee) {}
00058   
00059   STLContainerAdaptor(AdapteeType * adaptee) : m_AdapteeRef(*adaptee) {}
00060   
00061   ~STLContainerAdaptor()
00062     {
00063     m_AdapteeRef.Modified();
00064     }
00065   
00066   TargetType & GetSTLContainerRef()
00067     {
00068     return m_AdapteeRef.CastToSTLContainer(); 
00069     }
00070   
00071 };
00072 
00073 
00074 } // end namespace itk
00075 
00076 #endif
00077 

Generated at Tue Sep 15 05:05:12 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000