📄 fg__list_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>FishGUI: FG_List.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- 制作者 Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="main.html">首页</a> | <a class="qindex" href="modules.html">模块</a> | <a class="qindex" href="hierarchy.html">类继承关系</a> | <a class="qindex" href="classes.html">按字典顺序排序的列表</a> | <a class="qindex" href="annotated.html">组合类型列表</a> | <a class="qindex" href="files.html">文件列表</a> | <a class="qindex" href="functions.html">组合类型成员</a> | <a class="qindex" href="globals.html">文件成员</a></div><h1>FG_List.h</h1><a href="FG__List_8h.html">浏览该文件的文档。</a><div class="fragment"><pre>00001 <span class="comment">/*--------------------------------------------------------------------------</span>00002 <span class="comment"></span>00003 <span class="comment"> FG_list.h - 单、双向链表容器及迭代器头文件</span>00004 <span class="comment"></span>00005 <span class="comment"> 本程序是FishGUI软件的一部分</span>00006 <span class="comment"></span>00007 <span class="comment"> 版权所有 (C) 2003,2004 王咏武</span>00008 <span class="comment"> http://www.contextfree.net/wangyw/</span>00009 <span class="comment"></span>00010 <span class="comment">----------------------------------------------------------------------------</span>00011 <span class="comment"></span>00012 <span class="comment"> 作者对 FishGUI 软件及其所有源代码授权如下:</span>00013 <span class="comment"></span>00014 <span class="comment"> 允许任何个人、组织、机构、企业无偿获得、修改、使用、重新发布 FishGUI 软</span>00015 <span class="comment"> 件及其源代码,或按照有偿或者无偿的方式发行基于 FishGUI 源代码的全部或部</span>00016 <span class="comment"> 分内容开发的软件产品,——但行使以上权利时,须遵守以下约定:</span>00017 <span class="comment"></span>00018 <span class="comment"> 1、重新发布 FishGUI 软件及其源代码时,不得隐去软件及其源代码中原有的版</span>00019 <span class="comment"> 权信息和开发者标识。</span>00020 <span class="comment"></span>00021 <span class="comment"> 2、发行基于 FishGUI 源代码的全部或部分内容开发的软件产品时,必须在产品</span>00022 <span class="comment"> 的显著位置标明以下字样:</span>00023 <span class="comment"></span>00024 <span class="comment"> 【本产品的一部分功能是基于王咏武在 FishGUI 软件中的工作完成的】</span>00025 <span class="comment"></span>00026 <span class="comment"> 3、在正式出版物中引用 FishGUI 的文档、源代码或注释内容的,应注明软件的</span>00027 <span class="comment"> 原作者为王咏武。</span>00028 <span class="comment"></span>00029 <span class="comment">--------------------------------------------------------------------------*/</span>00039 <span class="preprocessor">#ifndef _FG_LIST_H_</span>00040 <span class="preprocessor"></span><span class="preprocessor">#define _FG_LIST_H_</span>00041 <span class="preprocessor"></span>00042 <span class="comment">//##ModelId=3FD88507008D</span>00047 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> ITEM><a name="l00048"></a><a class="code" href="structFG__SList__Node.html">00048</a> <span class="keyword">struct </span><a class="code" href="structFG__SList__Node.html">FG_SList_Node</a>00049 {00050 <span class="comment">//##ModelId=3FD8850802FC</span><a name="l00055"></a><a class="code" href="structFG__SList__Node.html#a0">00055</a> <span class="comment"></span> <a class="code" href="structFG__SList__Node.html#a0">FG_SList_Node</a>() : <a class="code" href="structFG__SList__Node.html#o0">m_pItem</a>(<a class="code" href="group__Utility.html#ga11">NULL</a>), m_pNext(<a class="code" href="group__Utility.html#ga11">NULL</a>) {}00056 00057 <span class="comment">//##ModelId=40925B4D03DE</span><a name="l00063"></a><a class="code" href="structFG__SList__Node.html#a1">00063</a> <span class="comment"></span> <a class="code" href="structFG__SList__Node.html#a0">FG_SList_Node</a>(ITEM * <span class="keyword">const</span> pItem) : <a class="code" href="structFG__SList__Node.html#o0">m_pItem</a>(pItem), m_pNext(<a class="code" href="group__Utility.html#ga11">NULL</a>) {}00064 00065 <span class="comment">//##ModelId=3FD8850802CA</span><a name="l00066"></a><a class="code" href="structFG__SList__Node.html#o0">00066</a> ITEM * <a class="code" href="structFG__SList__Node.html#o0">m_pItem</a>; 00067 <span class="comment">//##ModelId=3FD8850802E1</span><a name="l00068"></a><a class="code" href="structFG__SList__Node.html#o1">00068</a> <a class="code" href="structFG__SList__Node.html">FG_SList_Node</a> * m_pNext; 00069 };00070 00071 <span class="comment">//##ModelId=3FD885060262</span>00076 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> ITEM><a name="l00077"></a><a class="code" href="structFG__BList__Node.html">00077</a> <span class="keyword">struct </span><a class="code" href="structFG__BList__Node.html">FG_BList_Node</a>00078 {00079 <span class="comment">//##ModelId=3FD8850701E2</span><a name="l00084"></a><a class="code" href="structFG__BList__Node.html#a0">00084</a> <span class="comment"></span> <a class="code" href="structFG__BList__Node.html#a0">FG_BList_Node</a>() : m_pItem(<a class="code" href="group__Utility.html#ga11">NULL</a>), <a class="code" href="structFG__BList__Node.html#o1">m_pPrev</a>(<a class="code" href="group__Utility.html#ga11">NULL</a>), m_pNext(<a class="code" href="group__Utility.html#ga11">NULL</a>) {}00085 00086 <span class="comment">//##ModelId=40925B4C02E2</span><a name="l00092"></a><a class="code" href="structFG__BList__Node.html#a1">00092</a> <span class="comment"></span> <a class="code" href="structFG__BList__Node.html#a0">FG_BList_Node</a>(ITEM * <span class="keyword">const</span> pItem) : m_pItem(pItem), <a class="code" href="structFG__BList__Node.html#o1">m_pPrev</a>(<a class="code" href="group__Utility.html#ga11">NULL</a>), m_pNext(<a class="code" href="group__Utility.html#ga11">NULL</a>) {}00093 00094 <span class="comment">//##ModelId=3FD88507018A</span><a name="l00095"></a><a class="code" href="structFG__BList__Node.html#o0">00095</a> ITEM * m_pItem; 00096 <span class="comment">//##ModelId=3FD8850701A7</span><a name="l00097"></a><a class="code" href="structFG__BList__Node.html#o1">00097</a> <a class="code" href="structFG__BList__Node.html">FG_BList_Node</a> * <a class="code" href="structFG__BList__Node.html#o1">m_pPrev</a>; 00098 <span class="comment">//##ModelId=3FD8850701C7</span><a name="l00099"></a><a class="code" href="structFG__BList__Node.html#o2">00099</a> <a class="code" href="structFG__BList__Node.html">FG_BList_Node</a> * m_pNext; 00100 };00101 00102 <span class="comment">//##ModelId=3FD8850602EF</span>00108 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> NODE, <span class="keyword">class</span> ITEM><a name="l00109"></a><a class="code" href="classFG__ForwardIterator.html">00109</a> <span class="keyword">class </span><a class="code" href="classFG__ForwardIterator.html">FG_ForwardIterator</a>00110 {00111 <span class="keyword">public</span>:00112 <span class="comment">//##ModelId=3FD8850702DC</span><a name="l00114"></a><a class="code" href="classFG__ForwardIterator.html#a0">00114</a> <span class="comment"></span> <a class="code" href="classFG__ForwardIterator.html#a0">FG_ForwardIterator</a>() : <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>(<a class="code" href="group__Utility.html#ga11">NULL</a>) {}00115 00116 <span class="comment">//##ModelId=3FD8850702E6</span><a name="l00121"></a><a class="code" href="classFG__ForwardIterator.html#a1">00121</a> <span class="comment"></span> <a class="code" href="classFG__ForwardIterator.html#a0">FG_ForwardIterator</a>(NODE * <span class="keyword">const</span> pNode) : <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>(pNode) {}00122 00123 <span class="comment">//##ModelId=3FD8850702F0</span><a name="l00129"></a><a class="code" href="classFG__ForwardIterator.html#a2">00129</a> <span class="comment"></span> ITEM & <a class="code" href="classFG__ForwardIterator.html#a2">operator*</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> * (<a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pItem); }00130 00131 <span class="comment">//##ModelId=3FD8850702FA</span><a name="l00137"></a><a class="code" href="classFG__ForwardIterator.html#a3">00137</a> <span class="comment"></span> ITEM * <a class="code" href="classFG__ForwardIterator.html#a3">operator-></a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pItem; }00138 00139 <span class="comment">//##ModelId=3FD885070304</span><a name="l00145"></a><a class="code" href="classFG__ForwardIterator.html#a4">00145</a> <span class="comment"></span> <a class="code" href="classFG__ForwardIterator.html#a4">operator ITEM *</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pItem; }00146 00147 <span class="comment">//##ModelId=3FD885070305</span><a name="l00153"></a><a class="code" href="classFG__ForwardIterator.html#a5">00153</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classFG__ForwardIterator.html#a5">IsDone</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ! <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>; }00154 00155 <span class="comment">//##ModelId=3FD88507030E</span><a name="l00161"></a><a class="code" href="classFG__ForwardIterator.html#a6">00161</a> <span class="comment"></span> <a class="code" href="classFG__ForwardIterator.html">FG_ForwardIterator</a> & <a class="code" href="classFG__ForwardIterator.html#a6">operator++</a>()00162 {00163 <span class="keywordflow">if</span> (<a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>)00164 <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a> = <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pNext;00165 <span class="keywordflow">return</span> * <span class="keyword">this</span>;00166 }00167 00168 <span class="comment">//##ModelId=3FD885070318</span><a name="l00174"></a><a class="code" href="classFG__ForwardIterator.html#a7">00174</a> <span class="comment"></span> <span class="keyword">const</span> <a class="code" href="classFG__ForwardIterator.html">FG_ForwardIterator</a> <a class="code" href="classFG__ForwardIterator.html#a6">operator++</a>(<span class="keywordtype">int</span>)00175 {00176 <a class="code" href="classFG__ForwardIterator.html">FG_ForwardIterator</a> tmp = * <span class="keyword">this</span>;00177 <span class="keywordflow">if</span> (<a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>) <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a> = <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pNext;00178 <span class="keywordflow">return</span> tmp;00179 }00180 00181 <span class="comment">//##ModelId=3FD885070323</span><a name="l00188"></a><a class="code" href="classFG__ForwardIterator.html#a8">00188</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classFG__ForwardIterator.html#a8">operator==</a>(<span class="keyword">const</span> <a class="code" href="classFG__ForwardIterator.html">FG_ForwardIterator</a> & i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a> == i.<a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>; }00189 00190 <span class="comment">//##ModelId=3FD885070336</span><a name="l00197"></a><a class="code" href="classFG__ForwardIterator.html#a9">00197</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classFG__ForwardIterator.html#a9">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classFG__ForwardIterator.html">FG_ForwardIterator</a> & i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a> != i.<a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>; }00198 00199 <span class="comment">//##ModelId=3FD88507034A</span><a name="l00206"></a><a class="code" href="classFG__ForwardIterator.html#a10">00206</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classFG__ForwardIterator.html#a8">operator==</a>(ITEM * <span class="keyword">const</span> p)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pItem == p; }00207 00208 <span class="comment">//##ModelId=3FD88507035E</span><a name="l00215"></a><a class="code" href="classFG__ForwardIterator.html#a11">00215</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classFG__ForwardIterator.html#a9">operator!=</a>(ITEM * <span class="keyword">const</span> p)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>->m_pItem != p; }00216 00217 <span class="keyword">protected</span>:00218 <span class="comment">//##ModelId=3FD8850702C9</span><a name="l00219"></a><a class="code" href="classFG__ForwardIterator.html#p0">00219</a> NODE * <a class="code" href="classFG__ForwardIterator.html#p0">m_pNode</a>; 00220 };
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -