autoc 1.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,916 +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::HashSet
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::HashSet";
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 (H)</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">HashSet</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::HashSet
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::HashSet</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>, <span class='object_link'><a href="Sets.html" title="AutoC::Sets (module)">Sets</a></span></dd>
101
- </dl>
102
-
103
-
104
-
105
-
106
-
107
-
108
- <dl>
109
- <dt>Defined in:</dt>
110
- <dd>lib/autoc/collection/hash_set.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>HashSet&lt; <strong><em>E</em></strong> &gt; is a hash-based unordered container holding unique elements.</p>
119
- </div>
120
- <div class="paragraph">
121
- <p>The collection&#8217;s C++ counterpart is std::unordered_set&lt;&gt; template class.</p>
122
- </div>
123
- <div class="sect1">
124
- <h2 id="_generated_c_interface">Generated C interface</h2>
125
- <div class="sectionbody">
126
- <div class="sect2">
127
- <h3 id="_collection_management">Collection management</h3>
128
- <table class="tableblock frame-all grid-all spread">
129
- <colgroup>
130
- <col style="width: 50%;">
131
- <col style="width: 50%;">
132
- </colgroup>
133
- <tbody>
134
- <tr>
135
- <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>
136
- <td class="tableblock halign-left valign-top"><p class="tableblock">Create a new set dst filled with the contents of src.
137
- A copy operation is performed on every element in src.
138
- </p><p class="tableblock">NOTE: Previous contents of dst is overwritten.</p></td>
139
- </tr>
140
- <tr>
141
- <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>
142
- <td class="tableblock halign-left valign-top"><p class="tableblock">Create a new empty set self.
143
- </p><p class="tableblock">NOTE: Previous contents of self is overwritten.</p></td>
144
- </tr>
145
- <tr>
146
- <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>
147
- <td class="tableblock halign-left valign-top"><p class="tableblock">Destroy set self.
148
- Stored elements are destroyed as well by calling the respective destructors.</p></td>
149
- </tr>
150
- <tr>
151
- <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>
152
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return non-zero value if sets lt and rt are considered equal by contents and zero value otherwise.</p></td>
153
- </tr>
154
- <tr>
155
- <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>
156
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return hash code for set self.</p></td>
157
- </tr>
158
- </tbody>
159
- </table>
160
- </div>
161
- <div class="sect2">
162
- <h3 id="_basic_operations">Basic operations</h3>
163
- <table class="tableblock frame-all grid-all spread">
164
- <colgroup>
165
- <col style="width: 50%;">
166
- <col style="width: 50%;">
167
- </colgroup>
168
- <tbody>
169
- <tr>
170
- <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>
171
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return non-zero value if set self contains an element considered equal to the element what and zero value otherwise.</p></td>
172
- </tr>
173
- <tr>
174
- <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>
175
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return non-zero value if set self contains no elements and zero value otherwise.</p></td>
176
- </tr>
177
- <tr>
178
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>E</em></strong> <sub>type</sub>Get(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
179
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return a <em>copy</em> of the element in self considered equal to the element what.
180
- </p><p class="tableblock">WARNING: self <strong>must</strong> contain such element otherwise the behavior is undefined. See <sub>type</sub>Contains().</p></td>
181
- </tr>
182
- <tr>
183
- <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>
184
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove and destroy all elements stored in self.</p></td>
185
- </tr>
186
- <tr>
187
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>int</em></strong> <sub>type</sub>Put(<strong><em>Type</em></strong> * self, <strong><em>E</em></strong> what)</p></td>
188
- <td class="tableblock halign-left valign-top"><p class="tableblock">Put a <em>copy</em> of the element what into self <strong>only if</strong> there is no such element in self which is considered equal to what.
189
- </p><p class="tableblock">Return non-zero value on successful element put (that is there was not such element in self) and zero value otherwise.</p></td>
190
- </tr>
191
- <tr>
192
- <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>
193
- <td class="tableblock halign-left valign-top"><p class="tableblock">If self contains an element which is considered equal to the element with,
194
- replace that element with a <em>copy</em> of with, otherwise do nothing.
195
- Replaced element is destroyed.
196
- </p><p class="tableblock">Return non-zero value if the replacement was actually performed and zero value otherwise.</p></td>
197
- </tr>
198
- <tr>
199
- <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>
200
- <td class="tableblock halign-left valign-top"><p class="tableblock">Remove and destroy an element in self which is considered equal to the element what.
201
- </p><p class="tableblock">Return non-zero value on successful element removal and zero value otherwise.</p></td>
202
- </tr>
203
- <tr>
204
- <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>
205
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return number of elements stored in self.</p></td>
206
- </tr>
207
- </tbody>
208
- </table>
209
- </div>
210
- <div class="sect2">
211
- <h3 id="_logical_operations">Logical operations</h3>
212
- <table class="tableblock frame-all grid-all spread">
213
- <colgroup>
214
- <col style="width: 50%;">
215
- <col style="width: 50%;">
216
- </colgroup>
217
- <tbody>
218
- <tr>
219
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Exclude(<strong><em>Type</em></strong> * self, <strong><em>Type</em></strong> * other)</p></td>
220
- <td class="tableblock halign-left valign-top"><p class="tableblock">Perform the difference operation that is self will retain only the elements not contained in other.
221
- </p><p class="tableblock">Removed elements are destroyed.</p></td>
222
- </tr>
223
- <tr>
224
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Include(<strong><em>Type</em></strong> * self, <strong><em>Type</em></strong> * other)</p></td>
225
- <td class="tableblock halign-left valign-top"><p class="tableblock">Perform the union operation that is self will contain the elements from both self and other.
226
- </p><p class="tableblock">self receives the <em>copies</em> of extra elements in other.</p></td>
227
- </tr>
228
- <tr>
229
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Invert(<strong><em>Type</em></strong> * self, <strong><em>Type</em></strong> * other)</p></td>
230
- <td class="tableblock halign-left valign-top"><p class="tableblock">Perform the symmetric difference operation that is self will retain the elements contained in either self or other, but not in both.
231
- </p><p class="tableblock">Removed elements are destroyed, extra elements are <em>copied</em>.</p></td>
232
- </tr>
233
- <tr>
234
- <td class="tableblock halign-left valign-top"><p class="tableblock"><strong><em>void</em></strong> <sub>type</sub>Retain(<strong><em>Type</em></strong> * self, <strong><em>Type</em></strong> * other)</p></td>
235
- <td class="tableblock halign-left valign-top"><p class="tableblock">Perform the intersection operation that is self will retain only the elements contained in both self and other.
236
- </p><p class="tableblock">Removed elements are destroyed.</p></td>
237
- </tr>
238
- </tbody>
239
- </table>
240
- </div>
241
- <div class="sect2">
242
- <h3 id="_iteration">Iteration</h3>
243
- <table class="tableblock frame-all grid-all spread">
244
- <colgroup>
245
- <col style="width: 50%;">
246
- <col style="width: 50%;">
247
- </colgroup>
248
- <tbody>
249
- <tr>
250
- <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>
251
- <td class="tableblock halign-left valign-top"><p class="tableblock">Create a new iterator it on set self.
252
- </p><p class="tableblock">NOTE: As the set is an unordered sequence, the traversal order is unspecified.
253
- </p><p class="tableblock">NOTE: Previous contents of it is overwritten.</p></td>
254
- </tr>
255
- <tr>
256
- <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>
257
- <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>
258
- </tr>
259
- <tr>
260
- <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>
261
- <td class="tableblock halign-left valign-top"><p class="tableblock">Return a <em>copy</em> of current element pointed to by the iterator it.
262
- </p><p class="tableblock">WARNING: current position <strong>must</strong> be valid otherwise the behavior is undefined. See <sub>it</sub>Move().</p></td>
263
- </tr>
264
- </tbody>
265
- </table>
266
- </div>
267
- </div>
268
- </div>
269
-
270
- </div>
271
- </div>
272
- <div class="tags">
273
-
274
-
275
- </div>
276
-
277
-
278
-
279
-
280
-
281
- <h2>Instance Attribute Summary</h2>
282
-
283
- <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Collection.html" title="AutoC::Collection (class)">Collection</a></span></h3>
284
- <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>
285
-
286
-
287
-
288
- <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></h3>
289
- <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>
290
-
291
-
292
-
293
- <h2>
294
- Instance Method Summary
295
- <small><a href="#" class="summary_toggle">collapse</a></small>
296
- </h2>
297
-
298
- <ul class="summary">
299
-
300
- <li class="public ">
301
- <span class="summary_signature">
302
-
303
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(*args) &#x21d2; HashSet </a>
304
-
305
-
306
-
307
- </span>
308
-
309
-
310
- <span class="note title constructor">constructor</span>
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
- <span class="summary_desc"><div class='inline'><div class="paragraph">
320
- <p>A new instance of HashSet.</p>
321
- </div></div></span>
322
-
323
- </li>
324
-
325
-
326
- <li class="public ">
327
- <span class="summary_signature">
328
-
329
- <a href="#write_impls-instance_method" title="#write_impls (instance method)">#<strong>write_impls</strong>(stream, define) &#x21d2; Object </a>
330
-
331
-
332
-
333
- </span>
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
- <span class="summary_desc"><div class='inline'></div></span>
344
-
345
- </li>
346
-
347
-
348
- <li class="public ">
349
- <span class="summary_signature">
350
-
351
- <a href="#write_intf_decls-instance_method" title="#write_intf_decls (instance method)">#<strong>write_intf_decls</strong>(stream, declare, define) &#x21d2; Object </a>
352
-
353
-
354
-
355
- </span>
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
- <span class="summary_desc"><div class='inline'></div></span>
366
-
367
- </li>
368
-
369
-
370
- <li class="public ">
371
- <span class="summary_signature">
372
-
373
- <a href="#write_intf_types-instance_method" title="#write_intf_types (instance method)">#<strong>write_intf_types</strong>(stream) &#x21d2; Object </a>
374
-
375
-
376
-
377
- </span>
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
- <span class="summary_desc"><div class='inline'></div></span>
388
-
389
- </li>
390
-
391
-
392
- </ul>
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
-
415
-
416
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Collection.html" title="AutoC::Collection (class)">Collection</a></span></h3>
417
- <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></p>
418
-
419
-
420
-
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></h3>
429
- <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#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>
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Code.html" title="AutoC::Code (class)">Code</a></span></h3>
440
- <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>
441
- <div id="constructor_details" class="method_details_list">
442
- <h2>Constructor Details</h2>
443
-
444
- <div class="method_details first">
445
- <h3 class="signature first" id="initialize-instance_method">
446
-
447
- #<strong>initialize</strong>(*args) &#x21d2; <tt><span class='object_link'><a href="" title="AutoC::HashSet (class)">HashSet</a></span></tt>
448
-
449
-
450
-
451
-
452
-
453
- </h3><div class="docstring">
454
- <div class="discussion">
455
- <div class="paragraph">
456
- <p>Returns a new instance of HashSet</p>
457
- </div>
458
-
459
- </div>
460
- </div>
461
- <div class="tags">
462
-
463
-
464
- </div><table class="source_code">
465
- <tr>
466
- <td>
467
- <pre class="lines">
468
-
469
-
470
- 155
471
- 156
472
- 157
473
- 158
474
- 159</pre>
475
- </td>
476
- <td>
477
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/hash_set.rb', line 155</span>
478
-
479
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
480
- <span class='kw'>super</span>
481
- <span class='ivar'>@list</span> <span class='op'>=</span> <span class='const'>List</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='comma'>,</span> <span class='id identifier rubyid_element'>element</span><span class='comma'>,</span> <span class='symbol'>:static</span><span class='rparen'>)</span>
482
- <span class='id identifier rubyid_key_requirement'>key_requirement</span><span class='lparen'>(</span><span class='id identifier rubyid_element'>element</span><span class='rparen'>)</span>
483
- <span class='kw'>end</span></pre>
484
- </td>
485
- </tr>
486
- </table>
487
- </div>
488
-
489
- </div>
490
- <div id="method_missing_details" class="method_details_list">
491
- <h2>Dynamic Method Handling</h2>
492
- <p class="notice super">
493
- This class handles dynamic methods through the <tt>method_missing</tt> method
494
-
495
- 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>
496
-
497
- </p>
498
-
499
- </div>
500
-
501
-
502
- <div id="instance_method_details" class="method_details_list">
503
- <h2>Instance Method Details</h2>
504
-
505
-
506
- <div class="method_details first">
507
- <h3 class="signature first" id="write_impls-instance_method">
508
-
509
- #<strong>write_impls</strong>(stream, define) &#x21d2; <tt>Object</tt>
510
-
511
-
512
-
513
-
514
-
515
- </h3><table class="source_code">
516
- <tr>
517
- <td>
518
- <pre class="lines">
519
-
520
-
521
- 185
522
- 186
523
- 187
524
- 188
525
- 189
526
- 190
527
- 191
528
- 192
529
- 193
530
- 194
531
- 195
532
- 196
533
- 197
534
- 198
535
- 199
536
- 200
537
- 201
538
- 202
539
- 203
540
- 204
541
- 205
542
- 206
543
- 207
544
- 208
545
- 209
546
- 210
547
- 211
548
- 212
549
- 213
550
- 214
551
- 215
552
- 216
553
- 217
554
- 218
555
- 219
556
- 220
557
- 221
558
- 222
559
- 223
560
- 224
561
- 225
562
- 226
563
- 227
564
- 228
565
- 229
566
- 230
567
- 231
568
- 232
569
- 233
570
- 234
571
- 235
572
- 236
573
- 237
574
- 238
575
- 239
576
- 240
577
- 241
578
- 242
579
- 243
580
- 244
581
- 245
582
- 246
583
- 247
584
- 248
585
- 249
586
- 250
587
- 251
588
- 252
589
- 253
590
- 254
591
- 255
592
- 256
593
- 257
594
- 258
595
- 259
596
- 260
597
- 261
598
- 262
599
- 263
600
- 264
601
- 265
602
- 266
603
- 267
604
- 268
605
- 269
606
- 270
607
- 271
608
- 272
609
- 273
610
- 274
611
- 275
612
- 276
613
- 277
614
- 278
615
- 279
616
- 280
617
- 281
618
- 282
619
- 283
620
- 284
621
- 285
622
- 286
623
- 287
624
- 288
625
- 289
626
- 290
627
- 291
628
- 292
629
- 293
630
- 294
631
- 295
632
- 296
633
- 297
634
- 298
635
- 299
636
- 300
637
- 301
638
- 302
639
- 303
640
- 304
641
- 305
642
- 306
643
- 307
644
- 308
645
- 309
646
- 310
647
- 311
648
- 312
649
- 313
650
- 314
651
- 315
652
- 316
653
- 317
654
- 318
655
- 319
656
- 320
657
- 321
658
- 322
659
- 323
660
- 324
661
- 325</pre>
662
- </td>
663
- <td>
664
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/hash_set.rb', line 185</span>
665
-
666
- <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>
667
- <span class='ivar'>@list</span><span class='period'>.</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_static'>static</span><span class='comma'>,</span> <span class='id identifier rubyid_inline'>inline</span><span class='rparen'>)</span>
668
- <span class='ivar'>@list</span><span class='period'>.</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_static'>static</span><span class='rparen'>)</span>
669
- <span class='kw'>super</span>
670
- <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'>
671
- static void </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rehash'>rehash</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) {
672
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> buckets;
673
- size_t index, bucket_count, size, fill;
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
- </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;min_fill &gt; 0);
676
- </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;max_fill &gt; 0);
677
- </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;min_fill &lt; self-&gt;max_fill);
678
- </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;min_bucket_count &gt; 0);
679
- if(self-&gt;buckets) {
680
- if(self-&gt;min_size &lt; self-&gt;size &amp;&amp; self-&gt;size &lt; self-&gt;max_size) return;
681
- fill = (size_t)((float)self-&gt;size/self-&gt;bucket_count*100);
682
- if(fill &gt; self-&gt;max_fill) {
683
- bucket_count = (size_t)((float)self-&gt;bucket_count/100*self-&gt;capacity_multiplier);
684
- } else
685
- if(fill &lt; self-&gt;min_fill &amp;&amp; self-&gt;bucket_count &gt; self-&gt;min_bucket_count) {
686
- bucket_count = (size_t)((float)self-&gt;bucket_count/self-&gt;capacity_multiplier*100);
687
- if(bucket_count &lt; self-&gt;min_bucket_count) bucket_count = self-&gt;min_bucket_count;
688
- } else
689
- return;
690
- size = self-&gt;size;
691
- self-&gt;min_size = (size_t)((float)self-&gt;min_fill/100*size);
692
- self-&gt;max_size = (size_t)((float)self-&gt;max_fill/100*size);
693
- } else {
694
- bucket_count = self-&gt;min_bucket_count;
695
- size = 0;
696
- }
697
- buckets = (</span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</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_malloc'>malloc</span><span class='embexpr_end'>}</span><span class='tstring_content'>(bucket_count*sizeof(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</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'>(buckets);
698
- for(index = 0; index &lt; bucket_count; ++index) {
699
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_ctor'>ctor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;buckets[index]);
700
- }
701
- if(self-&gt;buckets) {
702
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> it;
703
- </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, self);
704
- 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)) {
705
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>* bucket;
706
- </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 = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_itGet'>itGet</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;it);
707
- bucket = &amp;buckets[</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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> % bucket_count];
708
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='embexpr_end'>}</span><span class='tstring_content'>(bucket, element);
709
- </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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
710
- }
711
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dtor'>dtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
712
- }
713
- self-&gt;buckets = buckets;
714
- self-&gt;bucket_count = bucket_count;
715
- self-&gt;size = size;
716
- }
717
- </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'> {
718
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
719
- self-&gt;min_bucket_count = 16;
720
- self-&gt;min_fill = 20;
721
- self-&gt;max_fill = 80;
722
- self-&gt;min_size = (size_t)((float)self-&gt;min_fill/100*self-&gt;min_bucket_count);
723
- self-&gt;max_size = (size_t)((float)self-&gt;max_fill/100*self-&gt;min_bucket_count);
724
- self-&gt;capacity_multiplier = 200;
725
- self-&gt;buckets = NULL;
726
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rehash'>rehash</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
727
- }
728
- </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'> {
729
- size_t i;
730
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
731
- for(i = 0; i &lt; self-&gt;bucket_count; ++i) {
732
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_dtor'>dtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;buckets[i]);
733
- }
734
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_free'>free</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self-&gt;buckets);
735
- }
736
- </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) {
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_dtor'>dtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
739
- self-&gt;buckets = NULL;
740
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rehash'>rehash</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
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'> 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'> element) {
743
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
744
- return </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;buckets[</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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> % self-&gt;bucket_count], element);
745
- }
746
- </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_get'>get</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) {
747
- </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;
748
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
749
- </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, element));
750
- result = </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;buckets[</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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> % self-&gt;bucket_count], element);
751
- return result;
752
- }
753
- </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_put'>put</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) {
754
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> bucket;
755
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
756
- bucket = &amp;self-&gt;buckets[</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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> % self-&gt;bucket_count];
757
- if(!</span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='embexpr_end'>}</span><span class='tstring_content'>(bucket, element)) {
758
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='embexpr_end'>}</span><span class='tstring_content'>(bucket, element);
759
- ++self-&gt;size;
760
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rehash'>rehash</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
761
- return 1;
762
- }
763
- return 0;
764
- }
765
- </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_replace'>replace</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) {
766
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> bucket;
767
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
768
- bucket = &amp;self-&gt;buckets[</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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> % self-&gt;bucket_count];
769
- return </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span><span class='embexpr_end'>}</span><span class='tstring_content'>(bucket, element);
770
- }
771
- </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_remove'>remove</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) {
772
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> bucket;
773
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
774
- bucket = &amp;self-&gt;buckets[</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'>element</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> % self-&gt;bucket_count];
775
- if(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(bucket, element)) {
776
- --self-&gt;size;
777
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rehash'>rehash</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
778
- return 1;
779
- }
780
- return 0;
781
- }
782
- </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'> set) {
783
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
784
- self-&gt;set = set;
785
- self-&gt;bucket_index = self-&gt;set-&gt;bucket_count;
786
- }
787
- </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) {
788
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
789
- if(self-&gt;bucket_index &gt;= self-&gt;set-&gt;bucket_count) </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_itCtor'>itCtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;it, &amp;self-&gt;set-&gt;buckets[self-&gt;bucket_index = 0]);
790
- if(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_itMove'>itMove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;it)) return 1;
791
- while(++self-&gt;bucket_index &lt; self-&gt;set-&gt;bucket_count) {
792
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_itCtor'>itCtor</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;it, &amp;self-&gt;set-&gt;buckets[self-&gt;bucket_index]);
793
- if(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_itMove'>itMove</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;it)) return 1;
794
- }
795
- return 0;
796
- }
797
- </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) {
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
- return </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_itGet'>itGet</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;it);
800
- }
801
- 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) {
802
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_assert'>assert</span><span class='embexpr_end'>}</span><span class='tstring_content'>(self);
803
- return </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_itGetRef'>itGetRef</span><span class='embexpr_end'>}</span><span class='tstring_content'>(&amp;self-&gt;it);
804
- }
805
- </span><span class='tstring_end'>$</span></span>
806
- <span class='kw'>end</span></pre>
807
- </td>
808
- </tr>
809
- </table>
810
- </div>
811
-
812
- <div class="method_details ">
813
- <h3 class="signature " id="write_intf_decls-instance_method">
814
-
815
- #<strong>write_intf_decls</strong>(stream, declare, define) &#x21d2; <tt>Object</tt>
816
-
817
-
818
-
819
-
820
-
821
- </h3><table class="source_code">
822
- <tr>
823
- <td>
824
- <pre class="lines">
825
-
826
-
827
- 161
828
- 162
829
- 163</pre>
830
- </td>
831
- <td>
832
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/hash_set.rb', line 161</span>
833
-
834
- <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>
835
- <span class='kw'>super</span>
836
- <span class='kw'>end</span></pre>
837
- </td>
838
- </tr>
839
- </table>
840
- </div>
841
-
842
- <div class="method_details ">
843
- <h3 class="signature " id="write_intf_types-instance_method">
844
-
845
- #<strong>write_intf_types</strong>(stream) &#x21d2; <tt>Object</tt>
846
-
847
-
848
-
849
-
850
-
851
- </h3><table class="source_code">
852
- <tr>
853
- <td>
854
- <pre class="lines">
855
-
856
-
857
- 165
858
- 166
859
- 167
860
- 168
861
- 169
862
- 170
863
- 171
864
- 172
865
- 173
866
- 174
867
- 175
868
- 176
869
- 177
870
- 178
871
- 179
872
- 180
873
- 181
874
- 182
875
- 183</pre>
876
- </td>
877
- <td>
878
- <pre class="code"><span class="info file"># File 'lib/autoc/collection/hash_set.rb', line 165</span>
879
-
880
- <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>
881
- <span class='kw'>super</span>
882
- <span class='ivar'>@list</span><span class='period'>.</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>
883
- <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'>
884
- 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'>;
885
- 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'>;
886
- struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
887
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_type_ref'>type_ref</span><span class='embexpr_end'>}</span><span class='tstring_content'> buckets;
888
- size_t bucket_count, min_bucket_count;
889
- size_t size, min_size, max_size;
890
- unsigned min_fill, max_fill, capacity_multiplier; /* ?*1e-2 */
891
- };
892
- struct </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> {
893
- </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'> set;
894
- size_t bucket_index;
895
- </span><span class='embexpr_beg'>#{</span><span class='ivar'>@list</span><span class='period'>.</span><span class='id identifier rubyid_it'>it</span><span class='embexpr_end'>}</span><span class='tstring_content'> it;
896
- };
897
- </span><span class='tstring_end'>$</span></span>
898
- <span class='kw'>end</span></pre>
899
- </td>
900
- </tr>
901
- </table>
902
- </div>
903
-
904
- </div>
905
-
906
- </div>
907
-
908
- <div id="footer">
909
- Generated on Wed Oct 12 12:27:12 2016 by
910
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
911
- 0.9.5 (ruby-2.3.1).
912
- </div>
913
-
914
- </div>
915
- </body>
916
- </html>