亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? page121.html

?? wqeqwvrw rkjqhwrjwq jkhrjqwhrwq jkhrwq
?? HTML
字號:
<HTML>
<HEAD>
<TITLE>Iterators</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
 <img src="cover75.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cover75.gif" alt="Logo" align=right>
<b>Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++</b><br>
<A NAME="tex2html3405" HREF="page122.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page122.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html3403" HREF="page109.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page109.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html3397" HREF="page120.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page120.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html3407" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html3408" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <BR><HR>
<H2><A NAME="SECTION006270000000000000000">Iterators</A></H2>
<A NAME="secadtsiterators">&#160;</A>
<P>
In this section we introduce an abstraction called an <em>iterator</em>.
An iterator provides a means for visiting one-by-one all the
objects in a container.
Iterators are an alternative to using the visitors
described in Section&nbsp;<A HREF="page118.html#secadtsvisitors" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page118.html#secadtsvisitors"><IMG  ALIGN=BOTTOM ALT="gif" SRC="cross_ref_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cross_ref_motif.gif"></A>.
The basic idea is that for every concrete container class
we will also implement a related concrete iterator
derived from an abstract <tt>Iterator</tt> class.
<P>
Program&nbsp;<A HREF="page121.html#progiterator1h" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page121.html#progiterator1h"><IMG  ALIGN=BOTTOM ALT="gif" SRC="cross_ref_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cross_ref_motif.gif"></A> gives the declaration
of the abstract <tt>Iterator</tt> class.
It defines an interface comprised of
a virtual destructor and
four pure virtual member functions--<tt>Reset</tt>, <tt>IsDone</tt>  and two overloaded operators.
<P>
<P><A NAME="5517">&#160;</A><A NAME="progiterator1h">&#160;</A> <IMG WIDTH=575 HEIGHT=180 ALIGN=BOTTOM ALT="program5041" SRC="img694.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img694.gif"  ><BR>
<STRONG>Program:</STRONG> <tt>Iterator</tt> Class Definition<BR>
<P>
<P>
The <tt>Iterator</tt> class is intended to be used as the base class
from which other classes are derived in a polymorphic class hierarchy.
Consequently, the destructor is declared as a virtual member function.
Since the <tt>Iterator</tt> class is an abstract class which has
no member variables,
the behavior of the destructor trivial--it does nothing.
<P>
In addition to the destructor,
the <tt>Iterator</tt> class interface comprises
the <tt>Reset</tt> and <tt>IsDone</tt> functions and two overloaded operators--<tt>operator*</tt> and <tt>operator++</tt>.
In order to understand the desired semantics,
it is best to consider first an example which illustrates
the use of an iterator.
<P>
Consider the implementation of a concrete container class,
say <tt>SomeContainer</tt>,
which is derived from the abstract base class <tt>Container</tt>.
Associated with this container class is
a concrete iterator,
say <tt>SomeIterator</tt>,
which is derived from the abstract base class <tt>Iterator</tt>.
The following code fragment serves to illustrate the use of the iterator
to visit one-by-one the objects contained in the container:
<PRE>SomeContainer c;
Iterator&amp; i = c.NewIterator ();
while (!i.IsDone ()) {
    cout &lt;&lt; *i &lt;&lt; endl;
    ++i;
}
delete &amp;i;</PRE>
<P>
The <tt>NewIterator</tt> function of the <tt>SomeContainer</tt> class
is defined as follows:
<PRE>Iterator&amp; SomeContainer::NewIterator () const
    { return *new SomeIterator (*this); }</PRE>
I.e., given an instance <tt>c</tt> of <tt>SomeContainer</tt>,
the call
<PRE>c.NewIterator ();</PRE>
results in the creation of a new instance of <tt>SomeIterator</tt>
associated with container <tt>c</tt>.
<P>
In order to have the desired effect,
the member functions
<tt>IsDone</tt>, <tt>operator*</tt>, and <tt>operator++</tt>,
must have the following behaviors:
<DL ><DT><STRONG><tt>IsDone</tt></STRONG>
<DD>
	The <tt>IsDone</tt> member function is called
	in the loop-termination test of the <tt>while</tt> statement.
	The <tt>IsDone</tt> function returns <tt>false</tt>
	if the iterator still refers to an object in the container,
	and <tt>true</tt> when the container has been exhausted.
	I.e., if all of the contained objects have been visited.
    <DT><STRONG><tt>operator*</tt></STRONG>
<DD>
	The pointer dereferencing operator, <tt>operator*</tt>,
	is used to access the object to which the iterator currently refers.
	If this function is called when the container has been exhausted,
	a reference to the <tt>NullObject</tt> instance is returned.
    <DT><STRONG><tt>operator++</tt></STRONG>
<DD>
	The pre-increment operator is used to advance the iterator
	to the next object in the container.
	If the container is exhausted,
	the increment operator has no effect on the iterator.
<P>
 </DL>
Given these semantics for the iterator operators,
the program fragment shown above systematically visits
all of the objects in the container
and prints each one on its own line of the standard output file.
<P>
After an iterator has exhausted all the contained objects,
it can be reset via the <tt>Reset</tt> function
and used again like this:
<PRE>Iterator&amp; i = c.NewIterator ();
while (!i.IsDone ()) {
    cout &lt;&lt; *i &lt;&lt; endl;
    ++i;
}
i.Reset ()
while (!i.IsDone ()) {
    cout &lt;&lt; *i &lt;&lt; endl;
    ++i;
}
delete &amp;i;</PRE>
<P>
One of the advantages of using an iterator object which
is separate from the container is that it is possible then
to have more than one iterator associated with a given container.
This provides greater flexibility than possible using a visitor,
since only one visitor can be accepted by the container at any given time.
E.g., consider the following code fragment:
<PRE>SomeContainer c;
Iterator&amp; i = c.NewIterator ();
while (!i.IsDone ()) {
    Iterator&amp; j = c.NewIterator ();
    while (!j.IsDone ()) {
        if (*i == *j)
            cout &lt;&lt; *i &lt;&lt; endl;
	++j
    }
    delete &amp;j;
    ++i;
}
delete &amp;i;</PRE>
This code compares all pairs of objects, (<I>i</I>,<I>j</I>), in the container
and prints out those which are equal.
<P>
A certain amount of care is required when defining and using iterators.
In order to simplify the implementation of iterators,
we shall assume that while an iterator is in use,
the associated container will not be modified.
Specifically, this means that the no non-<tt>const</tt>
member function of the associated container may be called.
In particular, this also means that the container must not be deleted
while an iterator is in use!
<P>
<HR><A NAME="tex2html3405" HREF="page122.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page122.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html3403" HREF="page109.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page109.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html3397" HREF="page120.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page120.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html3407" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html3408" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <P><ADDRESS>
<img src="bruno.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/bruno.gif" alt="Bruno" align=right>
<a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html">Copyright &#169; 1997</a> by <a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.

</ADDRESS>
</BODY>
</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线丨porny丨国产| 欧美videofree性高清杂交| av中文字幕一区| 国产精品一级片在线观看| 亚洲欧美二区三区| 国产日韩欧美a| 久久精品亚洲国产奇米99| 欧美一区在线视频| 欧美日韩久久久久久| 欧美性xxxxx极品少妇| 成人激情动漫在线观看| 福利电影一区二区三区| 丁香另类激情小说| 国产成人啪午夜精品网站男同| 国产一区二区电影| 国产剧情一区二区| 成人一区二区三区| 不卡av在线网| 色综合网色综合| 欧美日韩在线播放| 欧美日韩精品专区| 日韩一区二区三区免费看| 56国语精品自产拍在线观看| 欧美一区二区三区视频| 欧美精品乱码久久久久久| 欧美亚洲国产一区在线观看网站| 欧美精品日日鲁夜夜添| 91精品国产欧美一区二区18 | 色av成人天堂桃色av| 91欧美激情一区二区三区成人| 91同城在线观看| 97久久久精品综合88久久| 色婷婷精品久久二区二区蜜臂av | 欧美视频中文字幕| 91麻豆精品国产91久久久更新时间| 欧美日韩国产经典色站一区二区三区| 欧美色综合天天久久综合精品| 欧美美女bb生活片| 久久综合色播五月| 欧美国产精品一区二区三区| 国产色91在线| 亚洲精品视频自拍| 性做久久久久久免费观看欧美| 奇米精品一区二区三区在线观看一| 蜜桃久久av一区| 成人精品一区二区三区四区| 99国内精品久久| 欧美在线观看一二区| 精品国产91乱码一区二区三区 | 另类小说综合欧美亚洲| 国产一区二区福利| 欧美在线观看一二区| 日韩精品专区在线影院观看| 精品美女一区二区三区| 国产精品欧美综合在线| 亚洲一卡二卡三卡四卡无卡久久| 久久精品国产亚洲aⅴ| 成人a级免费电影| 91精品国产综合久久国产大片| 欧美精品一区二| 日韩伦理免费电影| 日韩精品久久理论片| 国产成人夜色高潮福利影视| 欧洲国内综合视频| 久久综合九色综合97婷婷女人 | 国产精品欧美极品| 免费av成人在线| 97国产一区二区| 国产三级欧美三级日产三级99| 亚洲女人小视频在线观看| 国产酒店精品激情| 欧美性色黄大片| 欧美va日韩va| 亚洲综合色婷婷| 国产精品综合一区二区三区| 欧美视频一区二区三区| 国产色产综合产在线视频| 日本不卡在线视频| 9人人澡人人爽人人精品| 亚洲精品在线免费观看视频| 亚洲一区二区av在线| 97久久精品人人做人人爽50路| 欧美一级理论片| 亚洲女人的天堂| 成人免费的视频| 日韩精品一区二区三区中文不卡 | 国产成人高清视频| 欧美成人性战久久| 亚洲国产欧美另类丝袜| 91小宝寻花一区二区三区| www欧美成人18+| 美国三级日本三级久久99| 欧美综合在线视频| 亚洲精品美国一| 99九九99九九九视频精品| 国产三级欧美三级| 激情六月婷婷综合| 在线观看国产日韩| 国产精品久久夜| 奇米在线7777在线精品| 欧美日韩国产高清一区二区三区 | 亚洲国产成人私人影院tom| 久久国产尿小便嘘嘘| 欧美天堂亚洲电影院在线播放| 国产精品女同互慰在线看| 亚洲123区在线观看| 欧美专区在线观看一区| 亚洲女厕所小便bbb| 99国内精品久久| 亚洲裸体xxx| 91丨porny丨在线| 亚洲精品伦理在线| 91麻豆.com| 亚洲精品乱码久久久久久黑人 | 欧美三级中文字幕| 一区二区在线免费观看| 欧美性猛交xxxx黑人交| 依依成人精品视频| 色一区在线观看| 亚洲精品国产a| www.亚洲精品| 亚洲综合免费观看高清在线观看| 91美女蜜桃在线| 亚洲国产精品视频| 欧美另类久久久品| 久久国产成人午夜av影院| 精品91自产拍在线观看一区| 国产成人丝袜美腿| 国产精品免费网站在线观看| 91丨porny丨户外露出| 日韩理论片中文av| 欧美日高清视频| 美女mm1313爽爽久久久蜜臀| 欧美色涩在线第一页| 日韩中文字幕亚洲一区二区va在线| 日本电影欧美片| 日av在线不卡| 久久这里只有精品视频网| 成人免费视频一区二区| 亚洲婷婷国产精品电影人久久| 91毛片在线观看| 一区二区三区四区在线| 欧美男男青年gay1069videost| 日本三级韩国三级欧美三级| 久久精品一区二区| 92国产精品观看| 日本中文字幕不卡| 国产午夜亚洲精品理论片色戒| av电影天堂一区二区在线观看| 亚洲欧美另类久久久精品2019| 欧美精品在线一区二区三区| 激情综合色丁香一区二区| 中文字幕欧美激情一区| 在线观看亚洲专区| 亚洲国产成人av| 久久久久高清精品| 成人性生交大片免费看视频在线| 亚洲综合色在线| xfplay精品久久| 欧美日韩另类国产亚洲欧美一级| 狠狠色丁香婷婷综合久久片| 一区二区三区日韩精品| 日韩一区二区在线看| 成人性生交大片免费看中文网站| 亚洲成人你懂的| 日韩欧美在线123| 99精品视频在线播放观看| 日韩av在线播放中文字幕| 中文字幕欧美一| 日韩区在线观看| 欧美日韩久久久久久| 高清不卡一区二区在线| 美女性感视频久久| 亚洲欧洲精品天堂一级| 久久综合久久综合九色| 欧美日韩精品一区二区三区蜜桃 | 中文字幕在线不卡| 在线亚洲一区观看| 国产中文字幕一区| 亚洲大片一区二区三区| 国产日韩欧美激情| 91精品国产综合久久久久久久久久| 91视频一区二区三区| 韩国中文字幕2020精品| 日韩中文字幕1| 亚洲日本va在线观看| 日本一区二区三区在线不卡| 欧美军同video69gay| 色猫猫国产区一区二在线视频| 韩国三级中文字幕hd久久精品| 日韩中文欧美在线| 一区2区3区在线看| 日韩一区在线看| 久久精品亚洲麻豆av一区二区 | 91九色最新地址| 91啪亚洲精品| 懂色av中文一区二区三区| 国产尤物一区二区在线| 日本三级亚洲精品| 日本成人在线不卡视频|