Fixed stdlib error for free() on pointer allocated with gc_alloc()
[libs.git] / docs / html / _array_iterator_8h-source.html
blob5612506765a69758408d429867d6677634dbf510
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3 <title>LibSylph: Sylph/Core/ArrayIterator.h Source File</title>
4 <link href="tabs.css" rel="stylesheet" type="text/css">
5 <link href="doxygen.css" rel="stylesheet" type="text/css">
6 </head><body>
7 <!-- Generated by Doxygen 1.5.8 -->
8 <div class="navigation" id="top">
9 <div class="tabs">
10 <ul>
11 <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
12 <li><a href="namespaces.html"><span>Namespaces</span></a></li>
13 <li><a href="annotated.html"><span>Classes</span></a></li>
14 <li class="current"><a href="files.html"><span>Files</span></a></li>
15 </ul>
16 </div>
17 <div class="tabs">
18 <ul>
19 <li><a href="files.html"><span>File&nbsp;List</span></a></li>
20 </ul>
21 </div>
22 <h1>Sylph/Core/ArrayIterator.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* </span>
23 <a name="l00002"></a>00002 <span class="comment"> * File: ArrayIterator.h</span>
24 <a name="l00003"></a>00003 <span class="comment"> * Author: frank</span>
25 <a name="l00004"></a>00004 <span class="comment"> *</span>
26 <a name="l00005"></a>00005 <span class="comment"> * Created on 8 februari 2009, 16:12</span>
27 <a name="l00006"></a>00006 <span class="comment"> */</span>
28 <a name="l00007"></a>00007
29 <a name="l00008"></a>00008 <span class="preprocessor">#ifndef ARRAYITERATOR_H_</span>
30 <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define ARRAYITERATOR_H_</span>
31 <a name="l00010"></a>00010 <span class="preprocessor"></span>
32 <a name="l00011"></a>00011 <span class="preprocessor">#include "Iterator.h"</span>
33 <a name="l00012"></a>00012 <span class="preprocessor">#include "Exception.h"</span>
34 <a name="l00013"></a>00013
35 <a name="l00014"></a>00014 SYLPH_START_NAMESPACE(Core)
36 <a name="l00015"></a>00015
37 <a name="l00016"></a>00016 class Array;
38 <a name="l00017"></a>00017
39 <a name="l00018"></a>00018 SYLPH_PUBLIC
40 <a name="l00019"></a>00019
41 <a name="l00030"></a>00030 template&lt;class T&gt;
42 <a name="l00031"></a><a class="code" href="class_sylph_1_1_core_1_1_array_iterator.html">00031</a> class <a class="code" href="class_sylph_1_1_core_1_1_array_iterator.html" title="This class provides an Iterator for Array.">ArrayIterator</a> : public virtual Iterator&lt;T&gt; {
43 <a name="l00032"></a>00032 <span class="keyword">public</span>:
44 <a name="l00037"></a><a class="code" href="class_sylph_1_1_core_1_1_array_iterator.html#b5b6b4a4fdd85b774ccea769c6ae59e4">00037</a> <a class="code" href="class_sylph_1_1_core_1_1_array_iterator.html#b5b6b4a4fdd85b774ccea769c6ae59e4" title="Default constructor.">ArrayIterator</a>(<a class="code" href="class_sylph_1_1_core_1_1_array.html" title="Array provides a safe array.">Array&lt;T&gt;</a> &amp; array) : ar(&amp;array) {}
45 <a name="l00041"></a><a class="code" href="class_sylph_1_1_core_1_1_array_iterator.html#7d3e8939869d7ff887e8c870de7a0ce8">00041</a> <span class="keyword">virtual</span> <a class="code" href="class_sylph_1_1_core_1_1_array_iterator.html#7d3e8939869d7ff887e8c870de7a0ce8" title="Default destructor.">~ArrayIterator</a>() {}
46 <a name="l00048"></a>00048 <span class="keywordtype">bool</span> hasNext() <span class="keyword">const</span>;
47 <a name="l00058"></a>00058 <span class="keyword">const</span> T &amp; next() <span class="keyword">const</span>;
48 <a name="l00059"></a>00059 <span class="keywordtype">bool</span> hasPrevious() <span class="keyword">const</span>;
49 <a name="l00060"></a>00060 <span class="keyword">const</span> T &amp; previous() <span class="keyword">const</span>;
50 <a name="l00061"></a>00061 std::size_t nextIndex() <span class="keyword">const</span>;
51 <a name="l00062"></a>00062 std::size_t previousIndex() <span class="keyword">const</span>;
52 <a name="l00063"></a>00063 <span class="keyword">protected</span>:
53 <a name="l00064"></a>00064 <a class="code" href="class_sylph_1_1_core_1_1_array.html" title="Array provides a safe array.">Array&lt;T&gt;</a> * ar;
54 <a name="l00065"></a>00065 T * last;
55 <a name="l00066"></a>00066 std::size_t idx = 0;
56 <a name="l00067"></a>00067 };
57 <a name="l00068"></a>00068
58 <a name="l00069"></a>00069 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
59 <a name="l00070"></a>00070 <span class="keyword">class </span>ArrayMutableIterator : <span class="keyword">public</span> <span class="keyword">virtual</span> MutableIterator&lt;T&gt;,
60 <a name="l00071"></a>00071 <span class="keyword">public</span> <span class="keyword">virtual</span> ArrayIterator&lt;T&gt; {
61 <a name="l00072"></a>00072 <span class="keyword">public</span>:
62 <a name="l00073"></a>00073 ArrayMutableIterator(Array&lt;T&gt; &amp; array) : ArrayIterator(ar) {}
63 <a name="l00074"></a>00074 <span class="keyword">virtual</span> ~ArrayMutableIterator() {}
64 <a name="l00075"></a>00075 <span class="keywordtype">void</span> <span class="keyword">set</span>(T &amp; t) <span class="keywordflow">throw</span>(Exception);
65 <a name="l00076"></a>00076 <span class="keywordtype">void</span> insert(T &amp; t) <span class="keywordflow">throw</span>(Exception);
66 <a name="l00077"></a>00077 <span class="keywordtype">void</span> <span class="keyword">remove</span>() <span class="keywordflow">throw</span>(Exception);
67 <a name="l00078"></a>00078 };
68 <a name="l00079"></a>00079
69 <a name="l00080"></a>00080 SYLPH_END_NAMESPACE(Core)
70 <a name="l00081"></a>00081
71 <a name="l00082"></a>00082 <span class="preprocessor">#endif </span><span class="comment">/* ARRAYITERATOR_H_ */</span>
72 <a name="l00083"></a>00083
73 </pre></div></div>
74 <hr size="1"><address style="text-align: right;"><small>Generated on Sat Mar 21 15:05:26 2009 for LibSylph by&nbsp;
75 <a href="http://www.doxygen.org/index.html">
76 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
77 </body>
78 </html>