00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSTLConstContainerAdaptor.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/11/26 18:05:01 $ 00007 Version: $Revision: 1.1 $ 00008 00009 Copyright (c) 2002 Insight 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 __itkSTLConstContainerAdaptor_h 00018 #define __itkSTLConstContainerAdaptor_h 00019 00032 namespace itk { 00033 00034 00035 template<typename TContainer> 00036 class STLConstContainerAdaptor 00037 { 00038 public: 00039 00040 typedef const TContainer AdapteeType; 00041 00042 typedef const typename AdapteeType::Element ElementType; 00043 typedef const typename AdapteeType::STLContainerType TargetType; 00044 00045 00046 private: 00047 00048 AdapteeType & m_AdapteeRef; 00049 00051 STLConstContainerAdaptor(const STLConstContainerAdaptor & r); 00052 00053 /* hide and avoid operator= */ 00054 const STLConstContainerAdaptor & operator=(const STLConstContainerAdaptor & r); 00055 00056 00057 public: 00058 00059 STLConstContainerAdaptor(AdapteeType & adaptee) 00060 : m_AdapteeRef(adaptee) 00061 {} 00062 00063 STLConstContainerAdaptor(AdapteeType * adaptee) 00064 : m_AdapteeRef(*adaptee) 00065 {} 00066 00067 TargetType & GetSTLConstContainerRef() 00068 { 00069 return m_AdapteeRef.CastToSTLConstContainer(); 00070 } 00071 00072 }; 00073 00074 00075 } // end namespace itk 00076 00077 #endif