<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ITK: itkMapContainer.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a> </div> <div class="contents"> <h1>itkMapContainer.h</h1><a href="itkMapContainer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Insight Segmentation & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkMapContainer.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2009-02-05 19:05:01 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.49 $</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> Copyright (c) Insight Software Consortium. All rights reserved.</span> <a name="l00010"></a>00010 <span class="comment"> See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even </span> <a name="l00013"></a>00013 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR </span> <a name="l00014"></a>00014 <span class="comment"> PURPOSE. See the above copyright notices for more information.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span> <a name="l00017"></a>00017 <span class="preprocessor">#ifndef __itkMapContainer_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkMapContainer_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkObject_8h.html">itkObject.h</a>"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkObjectFactory_8h.html">itkObjectFactory.h</a>"</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="preprocessor">#include <map></span> <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keyword">namespace </span>itk <a name="l00026"></a>00026 { <a name="l00027"></a>00027 <a name="l00045"></a>00045 <span class="keyword">template</span> <<span class="keyword">typename</span> TElementIdentifier, <span class="keyword">typename</span> TElement> <a name="l00046"></a><a class="code" href="classitk_1_1MapContainer.html">00046</a> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer.html">MapContainer</a>: <a name="l00047"></a>00047 <span class="keyword">public</span> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>, <a name="l00048"></a>00048 <span class="keyword">public</span> std::map< TElementIdentifier , TElement > <a name="l00049"></a>00049 { <a name="l00050"></a>00050 <span class="keyword">public</span>: <a name="l00052"></a><a class="code" href="classitk_1_1MapContainer.html#cf32cdfb31bfc255618caee5446c50a5">00052</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1MapContainer.html">MapContainer</a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>; <a name="l00053"></a><a class="code" href="classitk_1_1MapContainer.html#8db92f4eefbec317a718c8e1629c4965">00053</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Superclass</a>; <a name="l00054"></a><a class="code" href="classitk_1_1MapContainer.html#6b7e5122a80945c2321c41e16493e91e">00054</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<Self></a> <a class="code" href="classitk_1_1SmartPointer.html">Pointer</a>; <a name="l00055"></a><a class="code" href="classitk_1_1MapContainer.html#abe1a4e18f487d259ae2b812e090ab3a">00055</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<const Self></a> <a class="code" href="classitk_1_1SmartPointer.html">ConstPointer</a>; <a name="l00056"></a>00056 <a name="l00058"></a><a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">00058</a> <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>(<a class="code" href="classitk_1_1MapContainer.html">MapContainer</a>, <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>); <a name="l00059"></a>00059 <a name="l00061"></a>00061 <span class="keyword">typedef</span> TElementIdentifier <a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>; <a name="l00062"></a><a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">00062</a> <span class="keyword">typedef</span> TElement <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>; <a name="l00063"></a>00063 <a name="l00064"></a>00064 <span class="keyword">private</span>: <a name="l00065"></a>00065 <a class="code" href="classitk_1_1MapContainer.html#06f5c17c0285d6959ed1a887d3b97d3d">MapContainer</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00066"></a>00066 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00067"></a>00067 <a name="l00069"></a>00069 <span class="keyword">typedef</span> std::map<ElementIdentifier, Element> MapType; <a name="l00070"></a>00070 <span class="keyword">typedef</span> <span class="keyword">typename</span> MapType::iterator MapIterator; <a name="l00071"></a>00071 <span class="keyword">typedef</span> <span class="keyword">typename</span> MapType::const_iterator MapConstIterator; <a name="l00072"></a>00072 <span class="keyword">typedef</span> <span class="keyword">typename</span> MapType::key_compare MapKeyCompareType; <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keyword">public</span>: <a name="l00078"></a><a class="code" href="classitk_1_1MapContainer.html#06f5c17c0285d6959ed1a887d3b97d3d">00078</a> <a class="code" href="classitk_1_1MapContainer.html#06f5c17c0285d6959ed1a887d3b97d3d">MapContainer</a>():MapType() {} <a name="l00079"></a><a class="code" href="classitk_1_1MapContainer.html#2c1234b09aa4f6eb6ea96381dbd81c37">00079</a> <a class="code" href="classitk_1_1MapContainer.html#2c1234b09aa4f6eb6ea96381dbd81c37">MapContainer</a>(<span class="keyword">const</span> MapKeyCompareType& comp):MapType(comp) {} <a name="l00080"></a>00080 <span class="comment">// MapContainer(const Self& r):MapType(r) {}</span> <a name="l00081"></a>00081 <span class="keyword">template</span> <<span class="keyword">typename</span> TInputIterator> <a name="l00082"></a><a class="code" href="classitk_1_1MapContainer.html#eb802024a877fd158afde654400fa4f4">00082</a> <a class="code" href="classitk_1_1MapContainer.html#eb802024a877fd158afde654400fa4f4">MapContainer</a>(TInputIterator first, TInputIterator last):MapType(first, last) {} <a name="l00083"></a>00083 <span class="keyword">template</span> <<span class="keyword">typename</span> TInputIterator> <a name="l00084"></a><a class="code" href="classitk_1_1MapContainer.html#3f69a0389288f0a4364ba04d80c1764b">00084</a> <a class="code" href="classitk_1_1MapContainer.html#06f5c17c0285d6959ed1a887d3b97d3d">MapContainer</a>(TInputIterator first, TInputIterator last,<span class="keyword">const</span> MapKeyCompareType& comp): <a name="l00085"></a>00085 MapType(first, last, comp) {} <a name="l00087"></a>00087 <a name="l00089"></a><a class="code" href="classitk_1_1MapContainer.html#15fa31feb59563405afb86a964e9c187">00089</a> <a class="code" href="itkMacro_8h.html#0fdc15685afa271857c57e7cd482f30c">itkNewMacro</a>(<a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>); <a name="l00090"></a>00090 <a name="l00092"></a>00092 <span class="keyword">typedef</span> MapType <a class="code" href="classitk_1_1MapContainer.html#15fa31feb59563405afb86a964e9c187">STLContainerType</a>; <a name="l00093"></a>00093 <a name="l00095"></a><a class="code" href="classitk_1_1MapContainer.html#ddcb97baaee4089459ae9a0f00748e44">00095</a> <a class="code" href="classitk_1_1MapContainer.html#15fa31feb59563405afb86a964e9c187">STLContainerType</a> & <a class="code" href="classitk_1_1MapContainer.html#ddcb97baaee4089459ae9a0f00748e44">CastToSTLContainer</a>() <a name="l00096"></a>00096 { <span class="keywordflow">return</span> <span class="keyword">dynamic_cast<</span><a class="code" href="classitk_1_1MapContainer.html#15fa31feb59563405afb86a964e9c187">STLContainerType</a> &<span class="keyword">></span>(*this); } <a name="l00097"></a>00097 <a name="l00099"></a><a class="code" href="classitk_1_1MapContainer.html#2cf4f04a442c57543b38f1365cdcff39">00099</a> <span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer.html#15fa31feb59563405afb86a964e9c187">STLContainerType</a> & <a class="code" href="classitk_1_1MapContainer.html#2cf4f04a442c57543b38f1365cdcff39">CastToSTLConstContainer</a>()<span class="keyword"> const</span> <a name="l00100"></a>00100 <span class="keyword"> </span>{ <a name="l00101"></a>00101 <span class="keywordflow">return</span> <span class="keyword">dynamic_cast<</span><span class="keyword">const </span><a class="code" href="classitk_1_1MapContainer.html#15fa31feb59563405afb86a964e9c187">STLContainerType</a> &<span class="keyword">></span>(*this); <a name="l00102"></a>00102 } <a name="l00103"></a>00103 <a name="l00105"></a>00105 <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer.html#9830fc407400559db7e7783cc10a9394">Iterator</a>; <a name="l00106"></a><a class="code" href="classitk_1_1MapContainer.html#9830fc407400559db7e7783cc10a9394">00106</a> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>; <a name="l00107"></a>00107 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>; <a name="l00108"></a><a class="code" href="classitk_1_1MapContainer.html#5485970bb9da6b5d782fa28638b5658f">00108</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>; <a name="l00109"></a>00109 <a name="l00112"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html">00112</a> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> <a name="l00113"></a>00113 { <a name="l00114"></a>00114 <span class="keyword">public</span>: <a name="l00115"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#4cdfad85c15771ef7c7632572bb1cc9f">00115</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#4cdfad85c15771ef7c7632572bb1cc9f">Iterator</a>() {} <a name="l00116"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#c7bb047da7c9f0298ea930473a7d76a7">00116</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#c7bb047da7c9f0298ea930473a7d76a7">Iterator</a>( <span class="keyword">const</span> MapIterator& i ): m_Iter(i) {} <a name="l00117"></a>00117 <a name="l00118"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#dd4adcf0a80d925066bba84147eeada0">00118</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#dd4adcf0a80d925066bba84147eeada0">operator* </a>() { <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00119"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#d8393a0abad4b344b9b00f4ab5631403">00119</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>* <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#d8393a0abad4b344b9b00f4ab5631403">operator-> </a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } <a name="l00120"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#4fb4837ae0ea759dbc1e72289c0117d7">00120</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#4fb4837ae0ea759dbc1e72289c0117d7">operator++ </a>() { ++m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00121"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#b55301ff464f683421fb577fc5d5dc46">00121</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#4fb4837ae0ea759dbc1e72289c0117d7">operator++ </a>(<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> temp(*<span class="keyword">this</span>); ++m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00122"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#f67af4a82672ca7cea36f724fae4e39a">00122</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#f67af4a82672ca7cea36f724fae4e39a">operator-- </a>() { --m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00123"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#2a8c94a2a5b36d2d3911507685f3caec">00123</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#f67af4a82672ca7cea36f724fae4e39a">operator-- </a>(<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> temp(*<span class="keyword">this</span>); --m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00124"></a>00124 <a name="l00125"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#b5e520533d1b3a1d9fd984aa8d9cc3b3">00125</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#b5e520533d1b3a1d9fd984aa8d9cc3b3">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00126"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#848506b90f2832c12c3503a114651251">00126</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#848506b90f2832c12c3503a114651251">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00127"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#f235dd01d5e2f9b256b786302edfcb2c">00127</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#b5e520533d1b3a1d9fd984aa8d9cc3b3">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00128"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#7a4e4b78fe94f8ab72fc62ab81bc594d">00128</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#848506b90f2832c12c3503a114651251">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00129"></a>00129 <a name="l00131"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#dcdefbee1f7b622dc08f0ed71060c217">00131</a> <a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#dcdefbee1f7b622dc08f0ed71060c217">Index</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter->first; } <a name="l00132"></a>00132 <a name="l00134"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#979762a29a2bdda9595fd970bf040e90">00134</a> <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>& <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#979762a29a2bdda9595fd970bf040e90">Value</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> m_Iter->second; } <a name="l00135"></a>00135 <span class="keyword">private</span>: <a name="l00136"></a>00136 MapIterator m_Iter; <a name="l00137"></a><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html#5485970bb9da6b5d782fa28638b5658f">00137</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>; <a name="l00138"></a>00138 }; <a name="l00139"></a>00139 <a name="l00142"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html">00142</a> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> { <a name="l00143"></a>00143 <span class="keyword">public</span>: <a name="l00144"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#e574ff54ad6c45927c968233890e5630">00144</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#e574ff54ad6c45927c968233890e5630">ConstIterator</a>() {} <a name="l00145"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#31b4351db2b41d5ea2f6d37e3903262c">00145</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#31b4351db2b41d5ea2f6d37e3903262c">ConstIterator</a>(<span class="keyword">const</span> MapConstIterator& ci): m_Iter(ci) {} <a name="l00146"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#0a6fc9f2383963d419d085f7425b5d1a">00146</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#0a6fc9f2383963d419d085f7425b5d1a">ConstIterator</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& r) { m_Iter = r.m_Iter; } <a name="l00147"></a>00147 <a name="l00148"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#01820615a24ddfd4a6dd6f6bfc277f02">00148</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#01820615a24ddfd4a6dd6f6bfc277f02">operator* </a>() { <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00149"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#5b01b36ee366896bfd5db4da84e69f12">00149</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>* <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#5b01b36ee366896bfd5db4da84e69f12">operator-> </a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } <a name="l00150"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#a7c47f5db1e47fb0b27f815c3b351bb1">00150</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#a7c47f5db1e47fb0b27f815c3b351bb1">operator++ </a>() { ++m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00151"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#951ab0ec2cb965cd801af62d61af7fa4">00151</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#a7c47f5db1e47fb0b27f815c3b351bb1">operator++ </a>(<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> temp(*<span class="keyword">this</span>); ++m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00152"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#cd8bb751c4151a8755e1df7c9bb1a520">00152</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#cd8bb751c4151a8755e1df7c9bb1a520">operator-- </a>() { --m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00153"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#4e9233606a21bbe4b59ec402e8dc69dc">00153</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#cd8bb751c4151a8755e1df7c9bb1a520">operator-- </a>(<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> temp(*<span class="keyword">this</span>); --m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00154"></a>00154 <a name="l00155"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#5c95fbc127a69242bd2d7adfe9ddc6bf">00155</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#5c95fbc127a69242bd2d7adfe9ddc6bf">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00156"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#dc51e3108508859fde3689737774d993">00156</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#dc51e3108508859fde3689737774d993">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00157"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#1f4b623a4171d5337eb6b939e1e6dbe3">00157</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#5c95fbc127a69242bd2d7adfe9ddc6bf">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00158"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#f61c37a4261fc23d070e35407668352e">00158</a> <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#dc51e3108508859fde3689737774d993">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00159"></a>00159 <a name="l00161"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#9b2268ea814f367b64580203f50e44ef">00161</a> <a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a> <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#9b2268ea814f367b64580203f50e44ef">Index</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter->first; } <a name="l00162"></a>00162 <a name="l00164"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#75b82cee7b321bdbc61564c1f533a80a">00164</a> <span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>& <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#75b82cee7b321bdbc61564c1f533a80a">Value</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter->second; } <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="keyword">private</span>: <a name="l00167"></a>00167 MapConstIterator m_Iter; <a name="l00168"></a><a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html#9830fc407400559db7e7783cc10a9394">00168</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a>; <a name="l00169"></a>00169 }; <a name="l00170"></a>00170 <a name="l00171"></a>00171 <span class="comment">/* Declare the public interface routines. */</span> <a name="l00172"></a>00172 <a name="l00180"></a>00180 <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>& <a class="code" href="classitk_1_1MapContainer.html#8160a87947a5b95dfd38adfedfc5dca3">ElementAt</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>); <a name="l00181"></a>00181 <a name="l00186"></a>00186 <span class="keyword">const</span> <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>& <a class="code" href="classitk_1_1MapContainer.html#8160a87947a5b95dfd38adfedfc5dca3">ElementAt</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>) <span class="keyword">const</span>; <a name="l00187"></a>00187 <a name="l00195"></a>00195 <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>& <a class="code" href="classitk_1_1MapContainer.html#8d064bf0439a558ecf5dcec7e993a970">CreateElementAt</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>); <a name="l00196"></a>00196 <a name="l00201"></a>00201 <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a> <a class="code" href="classitk_1_1MapContainer.html#ffe840758c7037593ab153c31ca234ef">GetElement</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>) <span class="keyword">const</span>; <a name="l00202"></a>00202 <a name="l00207"></a>00207 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#3d484c49ebdbb14bfd07f2621e89fb02">SetElement</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>, <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>); <a name="l00208"></a>00208 <a name="l00213"></a>00213 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#281b84ed4c009bf954545c3735abeb06">InsertElement</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>, <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>); <a name="l00214"></a>00214 <a name="l00219"></a>00219 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer.html#0335eb7b41dea5d3e607ceef46fb749f">IndexExists</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>) <span class="keyword">const</span>; <a name="l00220"></a>00220 <a name="l00226"></a>00226 <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1MapContainer.html#c4409010a44d67d5723f158365f3ae3f">GetElementIfIndexExists</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>, <a class="code" href="classitk_1_1MapContainer.html#4f063968aa014c3b7a6aabb99a2f783a">Element</a>*) <span class="keyword">const</span>; <a name="l00227"></a>00227 <a name="l00233"></a>00233 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#30550dc73715dce7d385f561cfef6543">CreateIndex</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>); <a name="l00234"></a>00234 <a name="l00239"></a>00239 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#50fd2e0bf45e0c415c3c908719090710">DeleteIndex</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>); <a name="l00240"></a>00240 <a name="l00244"></a>00244 <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> <a class="code" href="classitk_1_1MapContainer.html#503d17834c6739b552eda20d532f6c33">Begin</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00245"></a>00245 <a name="l00249"></a>00249 <a class="code" href="classitk_1_1MapContainer_1_1ConstIterator.html" title="The const iterator type for the map.">ConstIterator</a> <a class="code" href="classitk_1_1MapContainer.html#15b5a9afb166083606a9334cc8f435ec">End</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00250"></a>00250 <a name="l00254"></a>00254 <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> <a class="code" href="classitk_1_1MapContainer.html#503d17834c6739b552eda20d532f6c33">Begin</a>(<span class="keywordtype">void</span>); <a name="l00255"></a>00255 <a name="l00259"></a>00259 <a class="code" href="classitk_1_1MapContainer_1_1Iterator.html" title="The non-const iterator type for the map.">Iterator</a> <a class="code" href="classitk_1_1MapContainer.html#15b5a9afb166083606a9334cc8f435ec">End</a>(<span class="keywordtype">void</span>); <a name="l00260"></a>00260 <a name="l00264"></a>00264 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classitk_1_1MapContainer.html#e7c9aef1c3fadd0e9a0ea580fa0dffbb">Size</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00265"></a>00265 <a name="l00272"></a>00272 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#bed3ce0c31124b6075f4666ce8c9d414">Reserve</a>(<a class="code" href="classitk_1_1MapContainer.html#e3f85ef76a2c1b06b9a702e1c6fa8758">ElementIdentifier</a>); <a name="l00273"></a>00273 <a name="l00279"></a>00279 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#86af660e144ab15bdccb6cccc8487154">Squeeze</a>(<span class="keywordtype">void</span>); <a name="l00280"></a>00280 <a name="l00285"></a>00285 <span class="keywordtype">void</span> <a class="code" href="classitk_1_1MapContainer.html#35ff9c9900490680b5c2d4ce91d10db1">Initialize</a>(<span class="keywordtype">void</span>); <a name="l00286"></a>00286 <a name="l00287"></a>00287 }; <a name="l00288"></a>00288 <a name="l00289"></a>00289 } <span class="comment">// end namespace itk</span> <a name="l00290"></a>00290 <a name="l00291"></a>00291 <span class="comment">// Define instantiation macro for this template.</span> <a name="l00292"></a><a class="code" href="itkMapContainer_8h.html#72ef279ced90ae77f219a6eb17380ce8">00292</a> <span class="preprocessor">#define ITK_TEMPLATE_MapContainer(_, EXPORT, x, y) namespace itk { \</span> <a name="l00293"></a>00293 <span class="preprocessor"> _(2(class EXPORT MapContainer< ITK_TEMPLATE_2 x >)) \</span> <a name="l00294"></a>00294 <span class="preprocessor"> namespace Templates { typedef MapContainer< ITK_TEMPLATE_2 x > \</span> <a name="l00295"></a>00295 <span class="preprocessor"> MapContainer##y; } \</span> <a name="l00296"></a>00296 <span class="preprocessor"> }</span> <a name="l00297"></a>00297 <span class="preprocessor"></span> <a name="l00298"></a>00298 <span class="preprocessor">#if ITK_TEMPLATE_EXPLICIT</span> <a name="l00299"></a>00299 <span class="preprocessor"></span><span class="preprocessor"># include "Templates/itkMapContainer+-.h"</span> <a name="l00300"></a>00300 <span class="preprocessor">#endif</span> <a name="l00301"></a>00301 <span class="preprocessor"></span> <a name="l00302"></a>00302 <span class="preprocessor">#if ITK_TEMPLATE_TXX</span> <a name="l00303"></a>00303 <span class="preprocessor"></span><span class="preprocessor"># include "itkMapContainer.txx"</span> <a name="l00304"></a>00304 <span class="preprocessor">#endif</span> <a name="l00305"></a>00305 <span class="preprocessor"></span> <a name="l00306"></a>00306 <span class="preprocessor">#endif</span> <a name="l00307"></a>00307 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 23:26:54 2009 for ITK by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53> </a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>