<!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: itkVectorContainer.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>itkVectorContainer.h</h1><a href="itkVectorContainer_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: itkVectorContainer.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2007-12-23 17:59:29 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.58 $</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 __itkVectorContainer_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkVectorContainer_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 <utility></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <vector></span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">namespace </span>itk <a name="l00027"></a>00027 { <a name="l00028"></a>00028 <a name="l00044"></a>00044 <span class="keyword">template</span> < <a name="l00045"></a>00045 <span class="keyword">typename</span> TElementIdentifier, <a name="l00046"></a>00046 <span class="keyword">typename</span> TElement <a name="l00047"></a>00047 > <a name="l00048"></a><a class="code" href="classitk_1_1VectorContainer.html">00048</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a>: <a name="l00049"></a>00049 <span class="keyword">public</span> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>, <a name="l00050"></a>00050 <span class="keyword">public</span> std::<a class="code" href="classstd_1_1vector.html">vector</a><TElement> <a name="l00051"></a>00051 { <a name="l00052"></a>00052 <span class="keyword">public</span>: <a name="l00054"></a><a class="code" href="classitk_1_1VectorContainer.html#b11fe267e9dfd8c5b709d636f992869f">00054</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>; <a name="l00055"></a><a class="code" href="classitk_1_1VectorContainer.html#eea15de49ec92dab0c464438225e889f">00055</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_1LightObject.html" title="Light weight base class for most itk classes.">Superclass</a>; <a name="l00056"></a><a class="code" href="classitk_1_1VectorContainer.html#0be939c25293aa98656ba88552345171">00056</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="l00057"></a><a class="code" href="classitk_1_1VectorContainer.html#0503ec6871b4950a37e8a9a896f4723f">00057</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="l00058"></a>00058 <a name="l00060"></a><a class="code" href="classitk_1_1VectorContainer.html#f36d8eab6d392f302e874e97f6f630c4">00060</a> <span class="keyword">typedef</span> TElementIdentifier ElementIdentifier; <a name="l00061"></a><a class="code" href="classitk_1_1VectorContainer.html#1e59154dae054c8edc7a146a27b46fd2">00061</a> <span class="keyword">typedef</span> TElement Element; <a name="l00062"></a>00062 <a name="l00063"></a>00063 <span class="keyword">private</span>: <a name="l00065"></a>00065 <span class="keyword">typedef</span> std::vector<Element> VectorType; <a name="l00066"></a>00066 <span class="keyword">typedef</span> <span class="keyword">typename</span> VectorType::size_type size_type; <a name="l00067"></a>00067 <span class="keyword">typedef</span> <span class="keyword">typename</span> VectorType::iterator VectorIterator; <a name="l00068"></a>00068 <span class="keyword">typedef</span> <span class="keyword">typename</span> VectorType::const_iterator VectorConstIterator; <a name="l00069"></a>00069 <a name="l00070"></a>00070 <span class="keyword">protected</span>: <a name="l00074"></a><a class="code" href="classitk_1_1VectorContainer.html#35627adf20d878c85a48fde459da9f18">00074</a> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a>(): <a name="l00075"></a>00075 <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>(), VectorType() {} <a name="l00076"></a><a class="code" href="classitk_1_1VectorContainer.html#8e7f325bd020e145df41f05efeb58947">00076</a> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a>(size_type n): <a name="l00077"></a>00077 <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>(), VectorType(n) {} <a name="l00078"></a><a class="code" href="classitk_1_1VectorContainer.html#36ee8d2dc883a29e0eb34ea690c61fee">00078</a> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a>(size_type n, <span class="keyword">const</span> Element& x): <a name="l00079"></a>00079 <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>(), VectorType(n, x) {} <a name="l00080"></a><a class="code" href="classitk_1_1VectorContainer.html#2eef72f5cd4adff45f71ecf97ecd4e24">00080</a> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</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>& r): <a name="l00081"></a>00081 <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>(), VectorType(r) {} <a name="l00082"></a>00082 <span class="keyword">template</span> <<span class="keyword">typename</span> InputIterator> <a name="l00083"></a><a class="code" href="classitk_1_1VectorContainer.html#b0fd0f31d03ccebe73d1505811b70b5c">00083</a> <a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a>(InputIterator first, InputIterator last): <a name="l00084"></a>00084 <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>(), VectorType(first, last) {} <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="keyword">public</span>: <a name="l00088"></a>00088 <a name="l00090"></a><a class="code" href="classitk_1_1VectorContainer.html#9855bc8576397285db0c2589708133ff">00090</a> <span class="keyword">typedef</span> VectorType STLContainerType; <a name="l00091"></a><a class="code" href="classitk_1_1VectorContainer.html#838c1109619ec0c9a527138fa44f0f5a">00091</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> VectorType::size_type VectorContainerSizeType; <a name="l00092"></a>00092 <a name="l00094"></a>00094 <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="l00095"></a>00095 <a name="l00097"></a>00097 <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>(<a class="code" href="classitk_1_1VectorContainer.html">VectorContainer</a>, <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a>); <a name="l00098"></a>00098 <a name="l00100"></a>00100 <span class="keyword">class </span>Iterator; <a name="l00101"></a>00101 <span class="keyword">class </span>ConstIterator; <a name="l00102"></a>00102 <a name="l00104"></a><a class="code" href="classitk_1_1VectorContainer.html#2ec228e7653513528af03e7157eb2235">00104</a> STLContainerType & <a class="code" href="classitk_1_1VectorContainer.html#2ec228e7653513528af03e7157eb2235">CastToSTLContainer</a>() { <a name="l00105"></a>00105 <span class="keywordflow">return</span> <span class="keyword">dynamic_cast<</span>STLContainerType &<span class="keyword">></span>(*this); } <a name="l00106"></a>00106 <a name="l00108"></a><a class="code" href="classitk_1_1VectorContainer.html#0d19d7aeb9e88db1e926303e9aa9aae0">00108</a> <span class="keyword">const</span> STLContainerType & <a class="code" href="classitk_1_1VectorContainer.html#0d19d7aeb9e88db1e926303e9aa9aae0">CastToSTLConstContainer</a>()<span class="keyword"> const </span>{ <a name="l00109"></a>00109 <span class="keywordflow">return</span> <span class="keyword">dynamic_cast<</span><span class="keyword">const </span>STLContainerType &<span class="keyword">></span>(*this); } <a name="l00110"></a>00110 <a name="l00112"></a><a class="code" href="classitk_1_1VectorContainer.html#9830fc407400559db7e7783cc10a9394">00112</a> <span class="keyword">friend</span> <span class="keyword">class </span>Iterator; <a name="l00113"></a><a class="code" href="classitk_1_1VectorContainer.html#5485970bb9da6b5d782fa28638b5658f">00113</a> <span class="keyword">friend</span> <span class="keyword">class </span>ConstIterator; <a name="l00114"></a>00114 <a name="l00117"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">00117</a> <span class="keyword">class </span><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> <a name="l00118"></a>00118 { <a name="l00119"></a>00119 <span class="keyword">public</span>: <a name="l00120"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#aca3bc5bed825a83ad751008d730be03">00120</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#aca3bc5bed825a83ad751008d730be03">Iterator</a>() {} <a name="l00121"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#731d32001b384337c53a4b3817e2ff87">00121</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#731d32001b384337c53a4b3817e2ff87">Iterator</a>(size_type d, <span class="keyword">const</span> VectorIterator& i): m_Pos(d), m_Iter(i) {} <a name="l00123"></a>00123 <a name="l00124"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#55884b2b95177af35647e5837d1c8891">00124</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& <a class="code" href="namespaceitk.html#f78c6e7736d8f1eb0a9924605a33cded">operator* </a>() { <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00125"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#8cc6324d3fbcd89ac953a827fd33cdec">00125</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>* operator-> () { <span class="keywordflow">return</span> <span class="keyword">this</span>; } <a name="l00126"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#7c86482961316acbe767f61b7a3a8dda">00126</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& operator++ () { ++m_Pos; ++m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00127"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#8110fd2002c4acc685a6e964924fe8ef">00127</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> operator++ (<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> temp(*<span class="keyword">this</span>); ++m_Pos; ++m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00128"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#bf7b2f8cbb0122cc8234f848c143c2a1">00128</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& operator-- () { --m_Pos; --m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00129"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#a60e999925543121f27a5a8454e20de0">00129</a> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> operator-- (<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> temp(*<span class="keyword">this</span>); --m_Pos; --m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00130"></a>00130 <a name="l00131"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#d414de9dc777e32d98e8c471070c0bab">00131</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00132"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#a0605aca35c32296d55d956fdefb5d4c">00132</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk_1_1ImageToImageFilterDetail.html#7bf30438b5d3bdc0eddbecd9b17baa3b">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00133"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#38488b250569dd3f8539f4b9b889ee7b">00133</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00134"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#17b570268fb07ff834e22725060fc88c">00134</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk_1_1ImageToImageFilterDetail.html#7bf30438b5d3bdc0eddbecd9b17baa3b">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00135"></a>00135 <a name="l00137"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#1f3fe07f2c5a760d43714d616d8bb239">00137</a> ElementIdentifier <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#1f3fe07f2c5a760d43714d616d8bb239">Index</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>ElementIdentifier<span class="keyword">></span>( m_Pos ); } <a name="l00138"></a>00138 <a name="l00140"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#ce8125804cf29ba5765d73a6ad509d98">00140</a> Element& <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#ce8125804cf29ba5765d73a6ad509d98">Value</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *m_Iter; } <a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="keyword">private</span>: <a name="l00143"></a>00143 size_type m_Pos; <a name="l00144"></a>00144 VectorIterator m_Iter; <a name="l00145"></a><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html#5485970bb9da6b5d782fa28638b5658f">00145</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>; <a name="l00146"></a>00146 }; <a name="l00147"></a>00147 <a name="l00150"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">00150</a> <span class="keyword">class </span><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> <a name="l00151"></a>00151 { <a name="l00152"></a>00152 <span class="keyword">public</span>: <a name="l00153"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#f46f616fb7f96d4a8876438e007907e0">00153</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#f46f616fb7f96d4a8876438e007907e0">ConstIterator</a>() {} <a name="l00154"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#24bf0efa06385853f7db3a0974ccc406">00154</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#24bf0efa06385853f7db3a0974ccc406">ConstIterator</a>(size_type d, <span class="keyword">const</span> VectorConstIterator& i): m_Pos(d), m_Iter(i) {} <a name="l00155"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#8cf638452d3e0dd2736834303002ea98">00155</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#8cf638452d3e0dd2736834303002ea98">ConstIterator</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& r) { m_Pos = r.m_Pos; m_Iter = r.m_Iter; } <a name="l00157"></a>00157 <a name="l00158"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#2f7cc9a03996ed091f596478c544201d">00158</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& <a class="code" href="namespaceitk.html#f78c6e7736d8f1eb0a9924605a33cded">operator* </a>() { <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00159"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#46d77b0ca45240a7c5394aa8ccf8e871">00159</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>* operator-> () { <span class="keywordflow">return</span> <span class="keyword">this</span>; } <a name="l00160"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#32f8b6210d1c38dd9feeba803244d54b">00160</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& operator++ () { ++m_Pos; ++m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00161"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#8f093e5ba359e1d7554d67ff9abfeb0d">00161</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> operator++ (<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> temp(*<span class="keyword">this</span>); ++m_Pos; ++m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00162"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#a09984fcca63cf5f1730d85360c87001">00162</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& operator-- () { --m_Pos; --m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00163"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#93db07a9a5b53ae1b09c703e5a42e9ef">00163</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> operator-- (<span class="keywordtype">int</span>) { <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> temp(*<span class="keyword">this</span>); --m_Pos; --m_Iter; <span class="keywordflow">return</span> temp; } <a name="l00164"></a>00164 <a name="l00165"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#47691cd5db5d6215ad3c169355862fde">00165</a> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& operator = (<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& r) { m_Pos = r.m_Pos; m_Iter = r.m_Iter; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } <a name="l00166"></a>00166 <a name="l00167"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#c90447fe6feacb419b43dcd448871bbf">00167</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00168"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#a9ec2b349d5903de9e2262d59303e469">00168</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk_1_1ImageToImageFilterDetail.html#7bf30438b5d3bdc0eddbecd9b17baa3b">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00169"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#e5c527e889283839db1e68b628cf7ccb">00169</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator == </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter == r.m_Iter; } <a name="l00170"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#501479c24ed6d70a1120f12efe4e93bb">00170</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk_1_1ImageToImageFilterDetail.html#7bf30438b5d3bdc0eddbecd9b17baa3b">operator != </a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a>& r)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_Iter != r.m_Iter; } <a name="l00171"></a>00171 <a name="l00173"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#8e5cdf26ed5c7ab3008576a29ea2ca5f">00173</a> ElementIdentifier <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#8e5cdf26ed5c7ab3008576a29ea2ca5f">Index</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>ElementIdentifier<span class="keyword">></span>( m_Pos ); } <a name="l00174"></a>00174 <a name="l00176"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#a5eb00b7df7ff34e0cc7f20e15661c8a">00176</a> <span class="keyword">const</span> Element& <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#a5eb00b7df7ff34e0cc7f20e15661c8a">Value</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *m_Iter; } <a name="l00177"></a>00177 <a name="l00178"></a>00178 <span class="keyword">private</span>: <a name="l00179"></a>00179 size_type m_Pos; <a name="l00180"></a>00180 VectorConstIterator m_Iter; <a name="l00181"></a><a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html#9830fc407400559db7e7783cc10a9394">00181</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a>; <a name="l00182"></a>00182 }; <a name="l00183"></a>00183 <a name="l00184"></a>00184 <span class="comment">/* Declare the public interface routines. */</span> <a name="l00185"></a>00185 <a name="l00194"></a>00194 Element& ElementAt(ElementIdentifier); <a name="l00195"></a>00195 <a name="l00202"></a>00202 <span class="keyword">const</span> Element& ElementAt(ElementIdentifier) <span class="keyword">const</span>; <a name="l00203"></a>00203 <a name="l00212"></a>00212 Element& CreateElementAt(ElementIdentifier); <a name="l00213"></a>00213 <a name="l00218"></a>00218 Element GetElement(ElementIdentifier) <span class="keyword">const</span>; <a name="l00219"></a>00219 <a name="l00224"></a>00224 <span class="keywordtype">void</span> SetElement(ElementIdentifier, Element ); <a name="l00225"></a>00225 <a name="l00231"></a>00231 <span class="keywordtype">void</span> InsertElement(ElementIdentifier, Element ); <a name="l00232"></a>00232 <a name="l00237"></a>00237 <span class="keywordtype">bool</span> IndexExists(ElementIdentifier) <span class="keyword">const</span>; <a name="l00238"></a>00238 <a name="l00244"></a>00244 <span class="keywordtype">bool</span> GetElementIfIndexExists(ElementIdentifier, Element*) <span class="keyword">const</span>; <a name="l00245"></a>00245 <a name="l00251"></a>00251 <span class="keywordtype">void</span> CreateIndex(ElementIdentifier); <a name="l00252"></a>00252 <a name="l00258"></a>00258 <span class="keywordtype">void</span> DeleteIndex(ElementIdentifier); <a name="l00259"></a>00259 <a name="l00263"></a>00263 <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> Begin(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00264"></a>00264 <a name="l00268"></a>00268 <a class="code" href="classitk_1_1VectorContainer_1_1ConstIterator.html">ConstIterator</a> End(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00269"></a>00269 <a name="l00273"></a>00273 <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> Begin(<span class="keywordtype">void</span>); <a name="l00274"></a>00274 <a name="l00278"></a>00278 <a class="code" href="classitk_1_1VectorContainer_1_1Iterator.html">Iterator</a> End(<span class="keywordtype">void</span>); <a name="l00279"></a>00279 <a name="l00283"></a>00283 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">Size</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>; <a name="l00284"></a>00284 <a name="l00294"></a>00294 <span class="keywordtype">void</span> Reserve( ElementIdentifier ); <a name="l00295"></a>00295 <a name="l00302"></a>00302 <span class="keywordtype">void</span> Squeeze(<span class="keywordtype">void</span>); <a name="l00303"></a>00303 <a name="l00307"></a>00307 <span class="keywordtype">void</span> Initialize(<span class="keywordtype">void</span>); <a name="l00308"></a>00308 <a name="l00309"></a>00309 }; <a name="l00310"></a>00310 <a name="l00311"></a>00311 } <span class="comment">// end namespace itk</span> <a name="l00312"></a>00312 <a name="l00313"></a>00313 <span class="comment">// Define instantiation macro for this template.</span> <a name="l00314"></a><a class="code" href="itkVectorContainer_8h.html#7bfbb8f35c514332f3c47b9762120f3e">00314</a> <span class="preprocessor">#define ITK_TEMPLATE_VectorContainer(_, EXPORT, x, y) namespace itk { \</span> <a name="l00315"></a>00315 <span class="preprocessor"> _(2(class EXPORT VectorContainer< ITK_TEMPLATE_2 x >)) \</span> <a name="l00316"></a>00316 <span class="preprocessor"> namespace Templates { typedef VectorContainer< ITK_TEMPLATE_2 x > \</span> <a name="l00317"></a>00317 <span class="preprocessor"> VectorContainer##y; } \</span> <a name="l00318"></a>00318 <span class="preprocessor"> }</span> <a name="l00319"></a>00319 <span class="preprocessor"></span> <a name="l00320"></a>00320 <span class="preprocessor">#if ITK_TEMPLATE_EXPLICIT</span> <a name="l00321"></a>00321 <span class="preprocessor"></span><span class="preprocessor"># include "Templates/itkVectorContainer+-.h"</span> <a name="l00322"></a>00322 <span class="preprocessor">#endif</span> <a name="l00323"></a>00323 <span class="preprocessor"></span> <a name="l00324"></a>00324 <span class="preprocessor">#if ITK_TEMPLATE_TXX</span> <a name="l00325"></a>00325 <span class="preprocessor"></span><span class="preprocessor"># include "itkVectorContainer.txx"</span> <a name="l00326"></a>00326 <span class="preprocessor">#endif</span> <a name="l00327"></a>00327 <span class="preprocessor"></span> <a name="l00328"></a>00328 <span class="preprocessor">#endif</span> <a name="l00329"></a>00329 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Fri May 8 00:28:04 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>