autoc 1.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +3 -0
  3. data/README.md +149 -0
  4. data/cmake/AutoC.cmake +39 -0
  5. data/lib/autoc/allocators.rb +51 -0
  6. data/lib/autoc/association.rb +126 -0
  7. data/lib/autoc/box.rb +311 -0
  8. data/lib/autoc/cmake.rb +54 -0
  9. data/lib/autoc/collection.rb +83 -110
  10. data/lib/autoc/composite.rb +333 -0
  11. data/lib/autoc/cstring.rb +263 -0
  12. data/lib/autoc/function.rb +247 -0
  13. data/lib/autoc/hash_map.rb +328 -0
  14. data/lib/autoc/hash_set.rb +339 -0
  15. data/lib/autoc/hashers.rb +102 -0
  16. data/lib/autoc/list.rb +444 -0
  17. data/lib/autoc/module.rb +434 -0
  18. data/lib/autoc/openmp.rb +15 -0
  19. data/lib/autoc/primitive.rb +27 -0
  20. data/lib/autoc/ranges.rb +707 -0
  21. data/lib/autoc/record.rb +247 -0
  22. data/lib/autoc/scaffold/docs.rb +117 -0
  23. data/lib/autoc/scaffold/generic_value.rb +86 -0
  24. data/lib/autoc/scaffold/project.rb +75 -0
  25. data/lib/autoc/scaffold/test_cstring.rb +113 -0
  26. data/lib/autoc/scaffold/test_cstring_hash_set.rb +35 -0
  27. data/lib/autoc/scaffold/test_int_box.rb +22 -0
  28. data/lib/autoc/scaffold/test_int_hash_set.rb +448 -0
  29. data/lib/autoc/scaffold/test_int_list.rb +106 -0
  30. data/lib/autoc/scaffold/test_int_vector.rb +83 -0
  31. data/lib/autoc/scaffold/test_v2v_hash_map.rb +83 -0
  32. data/lib/autoc/scaffold/test_value_hash_set.rb +60 -0
  33. data/lib/autoc/scaffold/test_value_vector.rb +146 -0
  34. data/{test/test.rb → lib/autoc/scaffold/tests.rb} +179 -158
  35. data/lib/autoc/scaffold.rb +12 -0
  36. data/lib/autoc/sequential.rb +99 -0
  37. data/lib/autoc/set.rb +331 -0
  38. data/lib/autoc/std.rb +149 -0
  39. data/lib/autoc/type.rb +93 -531
  40. data/lib/autoc/vector.rb +290 -0
  41. data/lib/autoc.rb +4 -35
  42. metadata +55 -85
  43. data/.yardopts +0 -4
  44. data/CHANGES +0 -23
  45. data/README +0 -28
  46. data/doc/AutoC/Code.html +0 -523
  47. data/doc/AutoC/Collection.html +0 -1214
  48. data/doc/AutoC/HashMap.html +0 -1441
  49. data/doc/AutoC/HashSet.html +0 -916
  50. data/doc/AutoC/Iterators/Bidirectional.html +0 -204
  51. data/doc/AutoC/Iterators/Unidirectional.html +0 -200
  52. data/doc/AutoC/Iterators.html +0 -126
  53. data/doc/AutoC/List.html +0 -1039
  54. data/doc/AutoC/Maps.html +0 -290
  55. data/doc/AutoC/Module/File.html +0 -415
  56. data/doc/AutoC/Module/Header.html +0 -437
  57. data/doc/AutoC/Module/Source.html +0 -707
  58. data/doc/AutoC/Module.html +0 -948
  59. data/doc/AutoC/Priority.html +0 -138
  60. data/doc/AutoC/Queue.html +0 -1172
  61. data/doc/AutoC/Reference.html +0 -735
  62. data/doc/AutoC/Sets.html +0 -520
  63. data/doc/AutoC/String.html +0 -1394
  64. data/doc/AutoC/TreeMap.html +0 -1565
  65. data/doc/AutoC/TreeSet.html +0 -1447
  66. data/doc/AutoC/Type.html +0 -2148
  67. data/doc/AutoC/UserDefinedType.html +0 -1047
  68. data/doc/AutoC/Vector.html +0 -987
  69. data/doc/AutoC.html +0 -331
  70. data/doc/_index.html +0 -388
  71. data/doc/class_list.html +0 -51
  72. data/doc/css/common.css +0 -1
  73. data/doc/css/full_list.css +0 -58
  74. data/doc/css/style.css +0 -481
  75. data/doc/file.CHANGES.html +0 -117
  76. data/doc/file.README.html +0 -116
  77. data/doc/file_list.html +0 -61
  78. data/doc/frames.html +0 -17
  79. data/doc/index.html +0 -116
  80. data/doc/js/app.js +0 -243
  81. data/doc/js/full_list.js +0 -216
  82. data/doc/js/jquery.js +0 -4
  83. data/doc/method_list.html +0 -1307
  84. data/doc/top-level-namespace.html +0 -112
  85. data/lib/autoc/code.rb +0 -237
  86. data/lib/autoc/collection/hash_map.rb +0 -385
  87. data/lib/autoc/collection/hash_set.rb +0 -337
  88. data/lib/autoc/collection/iterator.rb +0 -39
  89. data/lib/autoc/collection/list.rb +0 -429
  90. data/lib/autoc/collection/map.rb +0 -41
  91. data/lib/autoc/collection/queue.rb +0 -517
  92. data/lib/autoc/collection/set.rb +0 -134
  93. data/lib/autoc/collection/tree_map.rb +0 -464
  94. data/lib/autoc/collection/tree_set.rb +0 -611
  95. data/lib/autoc/collection/vector.rb +0 -336
  96. data/lib/autoc/string.rb +0 -492
  97. data/test/test_auto.c +0 -7141
  98. data/test/test_auto.h +0 -753
  99. data/test/test_char_string.rb +0 -270
  100. data/test/test_int_list.rb +0 -35
  101. data/test/test_int_tree_set.rb +0 -111
  102. data/test/test_int_vector.rb +0 -34
  103. data/test/test_value_hash_map.rb +0 -162
  104. data/test/test_value_hash_set.rb +0 -173
  105. data/test/test_value_list.rb +0 -193
  106. data/test/test_value_queue.rb +0 -275
  107. data/test/test_value_tree_map.rb +0 -176
  108. data/test/test_value_tree_set.rb +0 -173
  109. data/test/test_value_vector.rb +0 -155
  110. data/test/value.rb +0 -80
data/doc/AutoC/List.html DELETED
@@ -1,1039 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: AutoC::List
8
-
9
- &mdash; Documentation by YARD 0.9.5
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "AutoC::List";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (L)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../AutoC.html" title="AutoC (module)">AutoC</a></span></span>
41
- &raquo;
42
- <span class="title">List</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame" src="../class_list.html"></iframe>
63
-
64
- <div id="content"><h1>Class: AutoC::List
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName"><span class='object_link'><a href="Collection.html" title="AutoC::Collection (class)">Collection</a></span></span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next"><span class='object_link'><a href="Code.html" title="AutoC::Code (class)">Code</a></span></li>
80
-
81
- <li class="next"><span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></li>
82
-
83
- <li class="next"><span class='object_link'><a href="Collection.html" title="AutoC::Collection (class)">Collection</a></span></li>
84
-
85
- <li class="next">AutoC::List</li>
86
-
87
- </ul>
88
- <a href="#" class="inheritanceTree">show all</a>
89
-
90
- </dd>
91
- </dl>
92
-
93
-
94
-
95
-
96
-
97
-
98
- <dl>
99
- <dt>Includes:</dt>
100
- <dd><span class='object_link'><a href="Iterators/Unidirectional.html" title="AutoC::Iterators::Unidirectional (module)">Iterators::Unidirectional</a></span></dd>
101
- </dl>
102
-
103
-
104
-
105
-
106
-
107
-
108
- <dl>
109
- <dt>Defined in:</dt>
110
- <dd>lib/autoc/collection/list.rb</dd>
111
- </dl>
112
-
113
- </div>
114
-
115
- <h2>Overview</h2><div class="docstring">
116
- <div class="discussion">
117
- <div class="paragraph">
118
- <p>List&lt; <strong><em>E</em></strong> &gt; is an ordered unidirectional sequence container.
119
- List supports submission/polling operations on one end hence it can be used as a LIFO container (a stack).</p>
120
- </div>
121
- <div class="paragraph">
122
- <p>The collection&#8217;s C++ counterpart is std::forward_list&lt;&gt; template class.</p>
123
- </div>
124
- <div class="sect1">
125
- <h2 id="_generated_c_interface">Generated C interface</h2>
126
- <div class="sectionbody">
127
- <div class="sect2">
128
- <h3 id="_collection_management">Collection management</h3>
129
- <table class="tableblock frame-all grid-all spread">
130
- <colgroup>
131
- <col style="width: 50%;">
132
- <col style="width: 50%;">
133
- </colgroup>
134
- <tbody>
135
- <tr>
136
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Copy(<strong><em>Type</em></strong> * dst, <strong><em>Type</em></strong> * src)</p></td>
137
- <td class="tableblock halign-left valign-top"><p class="tableblock">Create a new list dst filled with the contents of src.
138
- A copy operation is performed on every element in src.
139
- </p><p class="tableblock">NOTE: Previous contents of dst is overwritten.</p></td>
140
- </tr>
141
- <tr>
142
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Ctor(<strong><em>Type</em></strong> * self)</p></td>
143
- <td class="tableblock halign-left valign-top"><p class="tableblock">Create a new empty list self.
144
- </p><p class="tableblock">NOTE: Previous contents of self is overwritten.</p></td>
145
- </tr>
146
- <tr>
147
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Dtor(<strong><em>Type</em></strong> * self)</p></td>
148
- <td class="tableblock halign-left valign-top"><p class="tableblock">Destroy list self.
149
- Stored elements are destroyed as well by calling the respective destructors.</p></td>
150
- </tr>
151
- <tr>
152
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>Equal(<strong><em>Type</em></strong> * lt, <strong><em>Type</em></strong> * rt)</p></td>
153
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return non-zero value if lists lt and rt are considered equal by contents and zero value otherwise.</p></td>
154
- </tr>
155
- <tr>
156
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>size_t</em></strong> <sub>type</sub>Identify(<strong><em>Type</em></strong> * self)</p></td>
157
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return hash code for list self.</p></td>
158
- </tr>
159
- </tbody>
160
- </table>
161
- </div>
162
- <div class="sect2">
163
- <h3 id="_basic_operations">Basic operations</h3>
164
- <table class="tableblock frame-all grid-all spread">
165
- <colgroup>
166
- <col style="width: 50%;">
167
- <col style="width: 50%;">
168
- </colgroup>
169
- <tbody>
170
- <tr>
171
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>Contains(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
172
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return non-zero value if list self contains (at least) one element considered equal to what and zero value otherwise.</p></td>
173
- </tr>
174
- <tr>
175
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>Empty(<strong><em>Type</em></strong> * self)</p></td>
176
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return non-zero value if list self contains no elements and zero value otherwise.</p></td>
177
- </tr>
178
- <tr>
179
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>E</em></strong> <sub>type</sub>Find(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
180
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return the <em>first</em> element of stored in self which is considered equal to what.
181
- </p><p class="tableblock">WARNING: self <strong>must</strong> contain such element otherwise the behavior is undefined. See <sub>type</sub>Contains().</p></td>
182
- </tr>
183
- <tr>
184
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>E</em></strong> <sub>type</sub>Peek(<strong><em>Type</em></strong> * self)</p></td>
185
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return a <em>copy</em> of the head element of self.
186
- </p><p class="tableblock">WARNING: self <strong>must not</strong> be empty otherwise the behavior is undefined. See <sub>type</sub>Empty().</p></td>
187
- </tr>
188
- <tr>
189
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>E</em></strong> <sub>type</sub>Pop(<strong><em>Type</em></strong> * self)</p></td>
190
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove head element of self <strong>and</strong> return it.
191
- </p><p class="tableblock">NOTE: The function returns the element itself, <strong>not</strong> a copy.
192
- </p><p class="tableblock">WARNING: self <strong>must not</strong> be empty otherwise the behavior is undefined. See <sub>type</sub>Empty().</p></td>
193
- </tr>
194
- <tr>
195
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Purge(<strong><em>Type</em></strong> * self)</p></td>
196
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove and destroy all elements stored in self.</p></td>
197
- </tr>
198
- <tr>
199
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Push(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
200
- <td class="tableblock halign-left valign-top"><p class="tableblock">Place a <em>copy</em> of the element what to the head of self.</p></td>
201
- </tr>
202
- <tr>
203
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>Replace(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> with)</p></td>
204
- <td class="tableblock halign-left valign-top"><p class="tableblock">Find the <em>first</em> occurrence of with in self and replace it with a <em>copy</em> of the element with.
205
- Replaced element is destroyed.
206
- </p><p class="tableblock">Return non-zero value on successful replacement and zero value if no suitable element was found.</p></td>
207
- </tr>
208
- <tr>
209
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>ReplaceAll(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> with)</p></td>
210
- <td class="tableblock halign-left valign-top"><p class="tableblock">Find <em>all</em> occurrences of with in self and replace them with <em>copies</em> of the element with.
211
- All replaced elements are destroyed.
212
- </p><p class="tableblock">Return number of successful replacements.</p></td>
213
- </tr>
214
- <tr>
215
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>ReplaceEx(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> with, <strong><em>int</em></strong> count)</p></td>
216
- <td class="tableblock halign-left valign-top"><p class="tableblock">Find at most count occurrences of with in self and replace them with <em>copies</em> of the element with.
217
- If count is negative, <em>all</em> occurrences are replaced instead.
218
- All replaced elements are destroyed.
219
- </p><p class="tableblock">Return number of successful replacements.</p></td>
220
- </tr>
221
- <tr>
222
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>Remove(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
223
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove and destroy the <em>first</em> occurrence of the element what in self.
224
- </p><p class="tableblock">Return non-zero value if element was removed and zero value otherwise.</p></td>
225
- </tr>
226
- <tr>
227
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>RemoveAll(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
228
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove and destroy <em>all</em> occurrences of the element what in self.
229
- </p><p class="tableblock">Return number of elements actually removed.</p></td>
230
- </tr>
231
- <tr>
232
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>RemoveEx(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what, <strong><em>int</em></strong> count)</p></td>
233
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove and destroy at most count occurrences of the element what in self.
234
- If count is negative, <em>all</em> occurrences are removed instead.
235
- </p><p class="tableblock">Return number of elements actually removed.</p></td>
236
- </tr>
237
- <tr>
238
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>size_t</em></strong> <sub>type</sub>Size(<strong><em>Type</em></strong> * self)</p></td>
239
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return number of elements stored in self.</p></td>
240
- </tr>
241
- </tbody>
242
- </table>
243
- </div>
244
- <div class="sect2">
245
- <h3 id="_iteration">Iteration</h3>
246
- <table class="tableblock frame-all grid-all spread">
247
- <colgroup>
248
- <col style="width: 50%;">
249
- <col style="width: 50%;">
250
- </colgroup>
251
- <tbody>
252
- <tr>
253
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>it</sub>Ctor(<strong><em>IteratorType</em></strong> * it, <strong><em>Type</em></strong> * self)</p></td>
254
- <td class="tableblock halign-left valign-top"><p class="tableblock">Create a new iterator it on list self.
255
- </p><p class="tableblock">NOTE: Previous contents of it is overwritten.</p></td>
256
- </tr>
257
- <tr>
258
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>it</sub>Move(<strong><em>IteratorType</em></strong> * it)</p></td>
259
- <td class="tableblock halign-left valign-top"><p class="tableblock">Advance iterator position of it <strong>and</strong> return non-zero value if new position is valid and zero value otherwise.</p></td>
260
- </tr>
261
- <tr>
262
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>E</em></strong> <sub>it</sub>Get(<strong><em>IteratorType</em></strong> * it)</p></td>
263
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return a <em>copy</em> of current element pointed to by the iterator it.
264
- </p><p class="tableblock">WARNING: current position <strong>must</strong> be valid otherwise the behavior is undefined. See <sub>it</sub>Move().</p></td>
265
- </tr>
266
- </tbody>
267
- </table>
268
- </div>
269
- </div>
270
- </div>
271
-
272
- </div>
273
- </div>
274
- <div class="tags">
275
-
276
-
277
- </div>
278
-
279
-
280
-
281
-
282
-
283
- <h2>Instance Attribute Summary</h2>
284
-
285
- <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Collection.html" title="AutoC::Collection (class)">Collection</a></span></h3>
286
- <p class="inherited"><span class='object_link'><a href="Collection.html#element-instance_method" title="AutoC::Collection#element (method)">#element</a></span>, <span class='object_link'><a href="Collection.html#it_ref-instance_method" title="AutoC::Collection#it_ref (method)">#it_ref</a></span></p>
287
-
288
-
289
-
290
- <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></h3>
291
- <p class="inherited"><span class='object_link'><a href="Type.html#type-instance_method" title="AutoC::Type#type (method)">#type</a></span>, <span class='object_link'><a href="Type.html#type_ref-instance_method" title="AutoC::Type#type_ref (method)">#type_ref</a></span></p>
292
-
293
-
294
-
295
- <h2>
296
- Instance Method Summary
297
- <small><a href="#" class="summary_toggle">collapse</a></small>
298
- </h2>
299
-
300
- <ul class="summary">
301
-
302
- <li class="public ">
303
- <span class="summary_signature">
304
-
305
- <a href="#write_impls-instance_method" title="#write_impls (instance method)">#<strong>write_impls</strong>(stream, define) &#x21d2; Object </a>
306
-
307
-
308
-
309
- </span>
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
- <span class="summary_desc"><div class='inline'></div></span>
320
-
321
- </li>
322
-
323
-
324
- <li class="public ">
325
- <span class="summary_signature">
326
-
327
- <a href="#write_intf_decls-instance_method" title="#write_intf_decls (instance method)">#<strong>write_intf_decls</strong>(stream, declare, define) &#x21d2; Object </a>
328
-
329
-
330
-
331
- </span>
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
- <span class="summary_desc"><div class='inline'></div></span>
342
-
343
- </li>
344
-
345
-
346
- <li class="public ">
347
- <span class="summary_signature">
348
-
349
- <a href="#write_intf_types-instance_method" title="#write_intf_types (instance method)">#<strong>write_intf_types</strong>(stream) &#x21d2; Object </a>
350
-
351
-
352
-
353
- </span>
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
- <span class="summary_desc"><div class='inline'></div></span>
364
-
365
- </li>
366
-
367
-
368
- </ul>
369
-
370
-
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Collection.html" title="AutoC::Collection (class)">Collection</a></span></h3>
387
- <p class="inherited"><span class='object_link'><a href="Collection.html#%3D%3D-instance_method" title="AutoC::Collection#== (method)">#==</a></span>, <span class='object_link'><a href="Collection.html#comparable%3F-instance_method" title="AutoC::Collection#comparable? (method)">#comparable?</a></span>, <span class='object_link'><a href="Collection.html#constructible%3F-instance_method" title="AutoC::Collection#constructible? (method)">#constructible?</a></span>, <span class='object_link'><a href="Collection.html#copyable%3F-instance_method" title="AutoC::Collection#copyable? (method)">#copyable?</a></span>, <span class='object_link'><a href="Collection.html#destructible%3F-instance_method" title="AutoC::Collection#destructible? (method)">#destructible?</a></span>, <span class='object_link'><a href="Collection.html#entities-instance_method" title="AutoC::Collection#entities (method)">#entities</a></span>, <span class='object_link'><a href="Collection.html#hash-instance_method" title="AutoC::Collection#hash (method)">#hash</a></span>, <span class='object_link'><a href="Collection.html#hashable%3F-instance_method" title="AutoC::Collection#hashable? (method)">#hashable?</a></span>, <span class='object_link'><a href="Collection.html#initializable%3F-instance_method" title="AutoC::Collection#initializable? (method)">#initializable?</a></span>, <span class='object_link'><a href="Collection.html#initialize-instance_method" title="AutoC::Collection#initialize (method)">#initialize</a></span></p>
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></h3>
399
- <p class="inherited"><span class='object_link'><a href="Type.html#%3D%3D-instance_method" title="AutoC::Type#== (method)">#==</a></span>, <span class='object_link'><a href="Type.html#abort-instance_method" title="AutoC::Type#abort (method)">#abort</a></span>, <span class='object_link'><a href="Type.html#assert-instance_method" title="AutoC::Type#assert (method)">#assert</a></span>, <span class='object_link'><a href="Type.html#calloc-instance_method" title="AutoC::Type#calloc (method)">#calloc</a></span>, <span class='object_link'><a href="Type.html#coerce-class_method" title="AutoC::Type.coerce (method)">coerce</a></span>, <span class='object_link'><a href="Type.html#comparable%3F-instance_method" title="AutoC::Type#comparable? (method)">#comparable?</a></span>, <span class='object_link'><a href="Type.html#constructible%3F-instance_method" title="AutoC::Type#constructible? (method)">#constructible?</a></span>, <span class='object_link'><a href="Type.html#copyable%3F-instance_method" title="AutoC::Type#copyable? (method)">#copyable?</a></span>, <span class='object_link'><a href="Type.html#destructible%3F-instance_method" title="AutoC::Type#destructible? (method)">#destructible?</a></span>, <span class='object_link'><a href="Type.html#entities-instance_method" title="AutoC::Type#entities (method)">#entities</a></span>, <span class='object_link'><a href="Type.html#extern-instance_method" title="AutoC::Type#extern (method)">#extern</a></span>, <span class='object_link'><a href="Type.html#free-instance_method" title="AutoC::Type#free (method)">#free</a></span>, <span class='object_link'><a href="Type.html#hash-instance_method" title="AutoC::Type#hash (method)">#hash</a></span>, <span class='object_link'><a href="Type.html#hashable%3F-instance_method" title="AutoC::Type#hashable? (method)">#hashable?</a></span>, <span class='object_link'><a href="Type.html#initializable%3F-instance_method" title="AutoC::Type#initializable? (method)">#initializable?</a></span>, <span class='object_link'><a href="Type.html#initialize-instance_method" title="AutoC::Type#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Type.html#inline-instance_method" title="AutoC::Type#inline (method)">#inline</a></span>, <span class='object_link'><a href="Type.html#malloc-instance_method" title="AutoC::Type#malloc (method)">#malloc</a></span>, <span class='object_link'><a href="Type.html#method_missing-instance_method" title="AutoC::Type#method_missing (method)">#method_missing</a></span>, <span class='object_link'><a href="Type.html#orderable%3F-instance_method" title="AutoC::Type#orderable? (method)">#orderable?</a></span>, <span class='object_link'><a href="Type.html#prefix-instance_method" title="AutoC::Type#prefix (method)">#prefix</a></span>, <span class='object_link'><a href="Type.html#private%3F-instance_method" title="AutoC::Type#private? (method)">#private?</a></span>, <span class='object_link'><a href="Type.html#public%3F-instance_method" title="AutoC::Type#public? (method)">#public?</a></span>, <span class='object_link'><a href="Type.html#sortable%3F-instance_method" title="AutoC::Type#sortable? (method)">#sortable?</a></span>, <span class='object_link'><a href="Type.html#static-instance_method" title="AutoC::Type#static (method)">#static</a></span>, <span class='object_link'><a href="Type.html#static%3F-instance_method" title="AutoC::Type#static? (method)">#static?</a></span>, <span class='object_link'><a href="Type.html#write_decls-instance_method" title="AutoC::Type#write_decls (method)">#write_decls</a></span>, <span class='object_link'><a href="Type.html#write_defs-instance_method" title="AutoC::Type#write_defs (method)">#write_defs</a></span>, <span class='object_link'><a href="Type.html#write_intf-instance_method" title="AutoC::Type#write_intf (method)">#write_intf</a></span></p>
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Code.html" title="AutoC::Code (class)">Code</a></span></h3>
410
- <p class="inherited"><span class='object_link'><a href="Code.html#attach-instance_method" title="AutoC::Code#attach (method)">#attach</a></span>, <span class='object_link'><a href="Code.html#entities-instance_method" title="AutoC::Code#entities (method)">#entities</a></span>, <span class='object_link'><a href="Code.html#priority-instance_method" title="AutoC::Code#priority (method)">#priority</a></span>, <span class='object_link'><a href="Code.html#source_size-instance_method" title="AutoC::Code#source_size (method)">#source_size</a></span>, <span class='object_link'><a href="Code.html#write_decls-instance_method" title="AutoC::Code#write_decls (method)">#write_decls</a></span>, <span class='object_link'><a href="Code.html#write_defs-instance_method" title="AutoC::Code#write_defs (method)">#write_defs</a></span>, <span class='object_link'><a href="Code.html#write_intf-instance_method" title="AutoC::Code#write_intf (method)">#write_intf</a></span></p>
411
- <div id="constructor_details" class="method_details_list">
412
- <h2>Constructor Details</h2>
413
-
414
- <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Collection.html#initialize-instance_method" title="AutoC::Collection#initialize (method)">AutoC::Collection</a></span></p>
415
-
416
- </div>
417
- <div id="method_missing_details" class="method_details_list">
418
- <h2>Dynamic Method Handling</h2>
419
- <p class="notice super">
420
- This class handles dynamic methods through the <tt>method_missing</tt> method
421
-
422
- in the class <span class='object_link'><a href="Type.html#method_missing-instance_method" title="AutoC::Type#method_missing (method)">AutoC::Type</a></span>
423
-
424
- </p>
425
-
426
- </div>
427
-
428
-
429
- <div id="instance_method_details" class="method_details_list">
430
- <h2>Instance Method Details</h2>
431
-
432
-
433
- <div class="method_details first">
434
- <h3 class="signature first" id="write_impls-instance_method">
435
-
436
- #<strong>write_impls</strong>(stream, define) &#x21d2; <tt>Object</tt>
437
-
438
-
439
-
440
-
441
-
442
- </h3><table class="source_code">
443
- <tr>
444
- <td>
445
- <pre class="lines">
446
-
447
-
448
- 214
449
- 215
450
- 216
451
- 217
452
- 218
453
- 219
454
- 220
455
- 221
456
- 222
457
- 223
458
- 224
459
- 225
460
- 226
461
- 227
462
- 228
463
- 229
464
- 230
465
- 231
466
- 232
467
- 233
468
- 234
469
- 235
470
- 236
471
- 237
472
- 238
473
- 239
474
- 240
475
- 241
476
- 242
477
- 243
478
- 244
479
- 245
480
- 246
481
- 247
482
- 248
483
- 249
484
- 250
485
- 251
486
- 252
487
- 253
488
- 254
489
- 255
490
- 256
491
- 257
492
- 258
493
- 259
494
- 260
495
- 261
496
- 262
497
- 263
498
- 264
499
- 265
500
- 266
501
- 267
502
- 268
503
- 269
504
- 270
505
- 271
506
- 272
507
- 273
508
- 274
509
- 275
510
- 276
511
- 277
512
- 278
513
- 279
514
- 280
515
- 281
516
- 282
517
- 283
518
- 284
519
- 285
520
- 286
521
- 287
522
- 288
523
- 289
524
- 290
525
- 291
526
- 292
527
- 293
528
- 294
529
- 295
530
- 296
531
- 297
532
- 298
533
- 299
534
- 300
535
- 301
536
- 302
537
- 303
538
- 304
539
- 305
540
- 306
541
- 307
542
- 308
543
- 309
544
- 310
545
- 311
546
- 312
547
- 313
548
- 314
549
- 315
550
- 316
551
- 317
552
- 318
553
- 319
554
- 320
555
- 321
556
- 322
557
- 323
558
- 324
559
- 325
560
- 326
561
- 327
562
- 328
563
- 329
564
- 330
565
- 331
566
- 332
567
- 333
568
- 334
569
- 335
570
- 336
571
- 337
572
- 338
573
- 339
574
- 340
575
- 341
576
- 342
577
- 343
578
- 344
579
- 345
580
- 346
581
- 347
582
- 348
583
- 349
584
- 350
585
- 351
586
- 352
587
- 353
588
- 354
589
- 355
590
- 356
591
- 357
592
- 358
593
- 359
594
- 360
595
- 361
596
- 362
597
- 363
598
- 364
599
- 365
600
- 366
601
- 367
602
- 368
603
- 369
604
- 370
605
- 371
606
- 372
607
- 373
608
- 374
609
- 375
610
- 376
611
- 377
612
- 378
613
- 379
614
- 380
615
- 381
616
- 382
617
- 383
618
- 384
619
- 385
620
- 386
621
- 387
622
- 388
623
- 389
624
- 390
625
- 391
626
- 392
627
- 393
628
- 394
629
- 395
630
- 396
631
- 397
632
- 398
633
- 399
634
- 400
635
- 401
636
- 402
637
- 403
638
- 404
639
- 405
640
- 406
641
- 407
642
- 408
643
- 409
644
- 410
645
- 411
646
- 412
647
- 413
648
- 414
649
- 415
650
- 416
651
- 417
652
- 418
653
- 419
654
- 420
655
- 421
656
- 422
657
- 423
658
- 424</pre>
659
- </td>
660
- <td>
661
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/list.rb', line 214</span>
662
-
663
- <span class='kw'>def</span> <span class='id identifier rubyid_write_impls'>write_impls</span><span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='comma'>,</span> <span class='id identifier rubyid_define'>define</span><span class='rparen'>)</span>
664
- <span class='kw'>super</span>
665
- <span class='id identifier rubyid_stream'>stream</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>%$</span><span class='tstring_content'>
666
- static </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGetRef'>itGetRef</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it_ref'>it_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
667
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctor'>ctor</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
668
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
669
- self-&gt;head_node = NULL;
670
- self-&gt;node_count = 0;
671
- }
672
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dtor'>dtor</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
673
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
674
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
675
- node = self-&gt;head_node;
676
- while(node) {
677
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* this_node = node;
678
- node = node-&gt;next_node;
679
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_dtor'>dtor</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>this_node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
680
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_free'>free</span><span class='embexpr_end'>}</span><span class='tstring_content'>(this_node);
681
- }
682
- }
683
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_copy'>copy</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
684
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> it;
685
- size_t index, size;
686
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>** elements;
687
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(src);
688
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(dst);
689
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctor'>ctor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(dst);
690
- if(!</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_empty'>empty</span><span class='embexpr_end'>}</span><span class='tstring_content'>(src)) {
691
- /* List is a LIFO type container therefore the insertion order into the destination container should be reversed */
692
- elements = (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>**)</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_malloc'>malloc</span><span class='embexpr_end'>}</span><span class='tstring_content'>((size = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>(src))*sizeof(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>*)); </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(elements);
693
- index = 0;
694
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itCtor'>itCtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;it, src);
695
- while(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itMove'>itMove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;it)) {
696
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(index &lt; size);
697
- elements[index++] = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGetRef'>itGetRef</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;it);
698
- }
699
- for(index = size; index &gt; 0; --index) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_push'>push</span><span class='embexpr_end'>}</span><span class='tstring_content'>(dst, *elements[index-1]); /* Be careful not to run into the underflow of the unsigned integer type */
700
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_free'>free</span><span class='embexpr_end'>}</span><span class='tstring_content'>(elements);
701
- }
702
- }
703
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_equal'>equal</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
704
- if(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>(lt) == </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>(rt)) {
705
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> lit, rit;
706
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itCtor'>itCtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;lit, lt);
707
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itCtor'>itCtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;rit, rt);
708
- while(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itMove'>itMove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;lit) &amp;&amp; </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itMove'>itMove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;rit)) {
709
- int equal;
710
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> le;
711
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> re;
712
- le = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGetRef'>itGetRef</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;lit);
713
- re = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGetRef'>itGetRef</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;rit);
714
- equal = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>*le</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>*re</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
715
- if(!equal) return 0;
716
- }
717
- return 1;
718
- } else
719
- return 0;
720
- }
721
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_identify'>identify</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
722
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
723
- size_t result = 0;
724
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
725
- for(node = self-&gt;head_node; node != NULL; node = node-&gt;next_node) {
726
- result ^= </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_identify'>identify</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
727
- result = AUTOC_RCYCLE(result);
728
- }
729
- return result;
730
- }
731
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> void </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_purge'>purge</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
732
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dtor'>dtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
733
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctor'>ctor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
734
- }
735
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_peek'>peek</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
736
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> result;
737
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
738
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(!</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_empty'>empty</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self));
739
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_copy'>copy</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>result</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>self-&gt;head_node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
740
- return result;
741
- }
742
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_pop'>pop</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
743
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
744
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> result;
745
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
746
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(!</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_empty'>empty</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self));
747
- node = self-&gt;head_node;
748
- result = node-&gt;element;
749
- self-&gt;head_node = self-&gt;head_node-&gt;next_node;
750
- --self-&gt;node_count;
751
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_free'>free</span><span class='embexpr_end'>}</span><span class='tstring_content'>(node);
752
- return result;
753
- }
754
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> void </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_push'>push</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> element) {
755
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
756
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
757
- node = (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>*)</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_malloc'>malloc</span><span class='embexpr_end'>}</span><span class='tstring_content'>(sizeof(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>)); </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(node);
758
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_copy'>copy</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
759
- node-&gt;next_node = self-&gt;head_node;
760
- self-&gt;head_node = node;
761
- ++self-&gt;node_count;
762
- }
763
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_contains'>contains</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> what) {
764
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
765
- int found = 0;
766
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
767
- node = self-&gt;head_node;
768
- while(node) {
769
- if(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>what</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>) {
770
- found = 1;
771
- break;
772
- }
773
- node = node-&gt;next_node;
774
- }
775
- return found;
776
- }
777
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_find'>find</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> what) {
778
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
779
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
780
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_contains'>contains</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, what));
781
- node = self-&gt;head_node;
782
- while(node) {
783
- if(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>what</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>) {
784
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> result;
785
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_copy'>copy</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>result</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
786
- return result;
787
- }
788
- node = node-&gt;next_node;
789
- }
790
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_abort'>abort</span><span class='embexpr_end'>}</span><span class='tstring_content'>();
791
- }
792
- /* FIXME: for the generality&#39;s sake there should be both `what` and `with` values
793
- This is not achievable without breaking the interface, however,
794
- therefore defer this change to the major version bump */
795
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replaceEx'>replaceEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> with, int count) {
796
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* node;
797
- int replaced = 0;
798
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
799
- if(count == 0) return 0;
800
- node = self-&gt;head_node;
801
- while(node) {
802
- if(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>with</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>) {
803
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_dtor'>dtor</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
804
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_copy'>copy</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>with</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
805
- ++replaced;
806
- if(count &gt; 0 &amp;&amp; replaced &gt;= count) break;
807
- }
808
- node = node-&gt;next_node;
809
- }
810
- return replaced;
811
- }
812
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_removeEx'>removeEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> what, int count) {
813
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'> *node, *prev_node;
814
- int removed = 0;
815
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
816
- if(count == 0) return 0;
817
- node = self-&gt;head_node;
818
- prev_node = NULL;
819
- while(node) {
820
- if(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>what</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>) {
821
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* this_node;
822
- if(prev_node) {
823
- this_node = prev_node-&gt;next_node = node-&gt;next_node;
824
- } else {
825
- this_node = self-&gt;head_node = node-&gt;next_node;
826
- }
827
- ++removed;
828
- --self-&gt;node_count;
829
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_dtor'>dtor</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
830
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_free'>free</span><span class='embexpr_end'>}</span><span class='tstring_content'>(node);
831
- node = this_node;
832
- if(count &gt; 0 &amp;&amp; removed &gt;= count) break;
833
- } else {
834
- prev_node = node;
835
- node = node-&gt;next_node;
836
- }
837
- }
838
- return removed;
839
- }
840
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> size_t </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
841
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
842
- return self-&gt;node_count;
843
- }
844
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> void </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itCtor'>itCtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it_ref'>it_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> list) {
845
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
846
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(list);
847
- self-&gt;start = 1;
848
- self-&gt;list = list;
849
- }
850
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itMove'>itMove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it_ref'>it_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
851
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
852
- if(self-&gt;start) {
853
- self-&gt;this_node = self-&gt;list-&gt;head_node;
854
- self-&gt;start = 0;
855
- } else {
856
- self-&gt;this_node = self-&gt;this_node ? self-&gt;this_node-&gt;next_node : NULL;
857
- }
858
- return self-&gt;this_node != NULL;
859
- }
860
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_define'>define</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGet'>itGet</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it_ref'>it_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
861
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> result;
862
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
863
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self-&gt;this_node);
864
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_copy'>copy</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>result</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>self-&gt;this_node-&gt;element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
865
- return result;
866
- }
867
- static </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGetRef'>itGetRef</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it_ref'>it_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> self) {
868
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
869
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self-&gt;this_node);
870
- return &amp;self-&gt;this_node-&gt;element;
871
- }
872
- </span><span class='tstring_end'>$</span></span>
873
- <span class='kw'>end</span></pre>
874
- </td>
875
- </tr>
876
- </table>
877
- </div>
878
-
879
- <div class="method_details ">
880
- <h3 class="signature " id="write_intf_decls-instance_method">
881
-
882
- #<strong>write_intf_decls</strong>(stream, declare, define) &#x21d2; <tt>Object</tt>
883
-
884
-
885
-
886
-
887
-
888
- </h3><table class="source_code">
889
- <tr>
890
- <td>
891
- <pre class="lines">
892
-
893
-
894
- 189
895
- 190
896
- 191
897
- 192
898
- 193
899
- 194
900
- 195
901
- 196
902
- 197
903
- 198
904
- 199
905
- 200
906
- 201
907
- 202
908
- 203
909
- 204
910
- 205
911
- 206
912
- 207
913
- 208
914
- 209
915
- 210
916
- 211
917
- 212</pre>
918
- </td>
919
- <td>
920
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/list.rb', line 189</span>
921
-
922
- <span class='kw'>def</span> <span class='id identifier rubyid_write_intf_decls'>write_intf_decls</span><span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='comma'>,</span> <span class='id identifier rubyid_declare'>declare</span><span class='comma'>,</span> <span class='id identifier rubyid_define'>define</span><span class='rparen'>)</span>
923
- <span class='kw'>super</span>
924
- <span class='id identifier rubyid_stream'>stream</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>%$</span><span class='tstring_content'>
925
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctor'>ctor</span><span class='period'>.</span><span class='id identifier rubyid_declaration'>declaration</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
926
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dtor'>dtor</span><span class='period'>.</span><span class='id identifier rubyid_declaration'>declaration</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
927
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_copy'>copy</span><span class='period'>.</span><span class='id identifier rubyid_declaration'>declaration</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
928
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_equal'>equal</span><span class='period'>.</span><span class='id identifier rubyid_declaration'>declaration</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
929
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_identify'>identify</span><span class='period'>.</span><span class='id identifier rubyid_declaration'>declaration</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
930
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> void </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_purge'>purge</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
931
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_peek'>peek</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
932
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_pop'>pop</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
933
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> void </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_push'>push</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
934
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_contains'>contains</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
935
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_find'>find</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
936
- #define </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replace'>replace</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, with) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replaceEx'>replaceEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, with, 1)
937
- #define </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replaceAll'>replaceAll</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, with) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replaceEx'>replaceEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, with, -1)
938
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replaceEx'>replaceEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>, int);
939
- #define </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_remove'>remove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, what) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_removeEx'>removeEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, what, 1)
940
- #define </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_removeAll'>removeAll</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, what) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_removeEx'>removeEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self, what, -1)
941
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> int </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_removeEx'>removeEx</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>, int);
942
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_declare'>declare</span><span class='embexpr_end'>}</span><span class='tstring_content'> size_t </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'>);
943
- #define </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_empty'>empty</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self) (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self) == 0)
944
- </span><span class='tstring_end'>$</span></span>
945
- <span class='kw'>end</span></pre>
946
- </td>
947
- </tr>
948
- </table>
949
- </div>
950
-
951
- <div class="method_details ">
952
- <h3 class="signature " id="write_intf_types-instance_method">
953
-
954
- #<strong>write_intf_types</strong>(stream) &#x21d2; <tt>Object</tt>
955
-
956
-
957
-
958
-
959
-
960
- </h3><table class="source_code">
961
- <tr>
962
- <td>
963
- <pre class="lines">
964
-
965
-
966
- 162
967
- 163
968
- 164
969
- 165
970
- 166
971
- 167
972
- 168
973
- 169
974
- 170
975
- 171
976
- 172
977
- 173
978
- 174
979
- 175
980
- 176
981
- 177
982
- 178
983
- 179
984
- 180
985
- 181
986
- 182
987
- 183
988
- 184
989
- 185
990
- 186
991
- 187</pre>
992
- </td>
993
- <td>
994
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/list.rb', line 162</span>
995
-
996
- <span class='kw'>def</span> <span class='id identifier rubyid_write_intf_types'>write_intf_types</span><span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='rparen'>)</span>
997
- <span class='kw'>super</span>
998
- <span class='id identifier rubyid_stream'>stream</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>%$</span><span class='tstring_content'>
999
- /***
1000
- **** </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>&gt;
1001
- ***/
1002
- </span><span class='tstring_end'>$</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_public?'>public?</span>
1003
- <span class='id identifier rubyid_stream'>stream</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>%$</span><span class='tstring_content'>
1004
- typedef struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1005
- typedef struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1006
- typedef struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1007
- struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
1008
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* head_node;
1009
- size_t node_count;
1010
- };
1011
- struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
1012
- int start;
1013
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> list;
1014
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* this_node;
1015
- };
1016
- struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
1017
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> element;
1018
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_node'>node</span><span class='embexpr_end'>}</span><span class='tstring_content'>* next_node;
1019
- };
1020
- </span><span class='tstring_end'>$</span></span>
1021
- <span class='kw'>end</span></pre>
1022
- </td>
1023
- </tr>
1024
- </table>
1025
- </div>
1026
-
1027
- </div>
1028
-
1029
- </div>
1030
-
1031
- <div id="footer">
1032
- Generated on Wed Oct 12 12:27:11 2016 by
1033
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1034
- 0.9.5 (ruby-2.3.1).
1035
- </div>
1036
-
1037
- </div>
1038
- </body>
1039
- </html>