autoc 0.8 → 1.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.
- checksums.yaml +7 -0
- data/README +15 -4
- data/doc/AutoC.html +245 -0
- data/doc/AutoC/Code.html +520 -0
- data/doc/AutoC/Collection.html +923 -0
- data/doc/AutoC/HashMap.html +1161 -0
- data/doc/AutoC/HashSet.html +1122 -0
- data/doc/AutoC/List.html +1002 -0
- data/doc/AutoC/Module.html +951 -0
- data/doc/AutoC/Module/File.html +412 -0
- data/doc/AutoC/Module/Header.html +432 -0
- data/doc/AutoC/Module/Source.html +704 -0
- data/doc/AutoC/Priority.html +138 -0
- data/doc/AutoC/Queue.html +1167 -0
- data/doc/AutoC/Type.html +1152 -0
- data/doc/AutoC/UserDefinedType.html +655 -0
- data/doc/AutoC/Vector.html +856 -0
- data/doc/_index.html +299 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +112 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +112 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +605 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/autoc.rb +35 -12
- data/lib/autoc/{code_builder.rb → code.rb} +230 -247
- data/lib/autoc/collection.rb +137 -0
- data/lib/autoc/collection/hash_map.rb +388 -0
- data/lib/autoc/collection/hash_set.rb +433 -0
- data/lib/autoc/collection/list.rb +410 -0
- data/lib/autoc/collection/queue.rb +514 -0
- data/lib/autoc/collection/vector.rb +295 -0
- data/lib/autoc/type.rb +198 -0
- data/test/test.c +921 -396
- data/test/test.h +41 -0
- data/test/test.rb +21 -26
- data/test/test_auto.c +2630 -3961
- data/test/test_auto.h +449 -560
- metadata +50 -17
- data/lib/autoc/data_struct_builder.rb +0 -1794
- data/lib/autoc/type_builder.rb +0 -24
- data/manual/manual.pdf +0 -0
@@ -0,0 +1,923 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: AutoC::Collection
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.4
|
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
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!AutoC/Collection.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../AutoC.html" title="AutoC (module)">AutoC</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Collection</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: AutoC::Collection
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="Code.html" title="AutoC::Code (class)">Code</a></span></li>
|
82
|
+
|
83
|
+
<li class="next"><span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></li>
|
84
|
+
|
85
|
+
<li class="next">AutoC::Collection</li>
|
86
|
+
|
87
|
+
</ul>
|
88
|
+
<a href="#" class="inheritanceTree">show all</a>
|
89
|
+
|
90
|
+
</dd>
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dt class="r2 last">Defined in:</dt>
|
101
|
+
<dd class="r2 last">lib/autoc/collection.rb</dd>
|
102
|
+
|
103
|
+
</dl>
|
104
|
+
<div class="clear"></div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
<div class="sect1">
|
109
|
+
<h2 id="_implemented_collections">Implemented collections</h2>
|
110
|
+
<div class="sectionbody">
|
111
|
+
<div class="ulist">
|
112
|
+
<ul>
|
113
|
+
<li>
|
114
|
+
<p><span class='object_link'><a href="Vector.html" title="AutoC::Vector (class)">Vector</a></span> a fixed-sized array</p>
|
115
|
+
</li>
|
116
|
+
<li>
|
117
|
+
<p><span class='object_link'><a href="List.html" title="AutoC::List (class)">List</a></span> a single linked list</p>
|
118
|
+
</li>
|
119
|
+
<li>
|
120
|
+
<p><span class='object_link'><a href="Queue.html" title="AutoC::Queue (class)">Queue</a></span> a double linked list</p>
|
121
|
+
</li>
|
122
|
+
<li>
|
123
|
+
<p><span class='object_link'><a href="HashSet.html" title="AutoC::HashSet (class)">HashSet</a></span> a hash-based set</p>
|
124
|
+
</li>
|
125
|
+
<li>
|
126
|
+
<p><span class='object_link'><a href="HashMap.html" title="AutoC::HashMap (class)">HashMap</a></span> a hash-based map</p>
|
127
|
+
</li>
|
128
|
+
</ul>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
<div class="sect1">
|
133
|
+
<h2 id="_ruby_side_operation">Ruby side operation</h2>
|
134
|
+
<div class="sectionbody">
|
135
|
+
<div class="listingblock">
|
136
|
+
<div class="title">Complete example for generation of a list of integers collection:</div>
|
137
|
+
<div class="content">
|
138
|
+
<pre class="highlight"><code class="ruby language-ruby">require "autoc"
|
139
|
+
AutoC::Module.generate!(:Test) do |c|
|
140
|
+
c << AutoC::List.new(:IntList, :int)
|
141
|
+
end</code></pre>
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
<div class="paragraph">
|
145
|
+
<p>In the above example a C module Test represented by the C header <code>test_auto.h</code> and the C source <code>test_auto.c</code> are generated.
|
146
|
+
The C++ counterpart of the generated collection is <code>std::forward_list<int></code>.</p>
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<div class="sect1">
|
151
|
+
<h2 id="_c_interface">C interface</h2>
|
152
|
+
<div class="sectionbody">
|
153
|
+
<div class="sect2">
|
154
|
+
<h3 id="_element_types_values_references">Element types: values, references</h3>
|
155
|
+
|
156
|
+
</div>
|
157
|
+
<div class="sect2">
|
158
|
+
<h3 id="_thread_safety">Thread safety</h3>
|
159
|
+
<div class="admonitionblock warning">
|
160
|
+
<table>
|
161
|
+
<tr>
|
162
|
+
<td class="icon">
|
163
|
+
<div class="title">Warning</div>
|
164
|
+
</td>
|
165
|
+
<td class="content">
|
166
|
+
In its current state the implemented collections are <strong>not</strong> thread-safe.
|
167
|
+
</td>
|
168
|
+
</tr>
|
169
|
+
</table>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
<div class="sect2">
|
173
|
+
<h3 id="_iteration">Iteration</h3>
|
174
|
+
<div class="paragraph">
|
175
|
+
<p>At the moment a fairly simple iteration functionality is implemented.
|
176
|
+
The iterators are modeled after the C# language.
|
177
|
+
All implemented iterators do not require destruction after use.</p>
|
178
|
+
</div>
|
179
|
+
<div class="listingblock">
|
180
|
+
<div class="title">Basic iterator usage example:</div>
|
181
|
+
<div class="content">
|
182
|
+
<pre class="highlight"><code class="c language-c">MyVector c;
|
183
|
+
MyVectorIt it;
|
184
|
+
...
|
185
|
+
MyVectorItCtor(&it, &c);
|
186
|
+
while(MyVectorItMove(&it)) {
|
187
|
+
Element e = MyVectorItGet(&it);
|
188
|
+
...
|
189
|
+
ElementDtor(e);
|
190
|
+
}</code></pre>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
<div class="admonitionblock warning">
|
194
|
+
<table>
|
195
|
+
<tr>
|
196
|
+
<td class="icon">
|
197
|
+
<div class="title">Warning</div>
|
198
|
+
</td>
|
199
|
+
<td class="content">
|
200
|
+
the collection being iterated <strong>must not</strong> be modified in any way otherwise the iterator behavior is undefined.
|
201
|
+
</td>
|
202
|
+
</tr>
|
203
|
+
</table>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
<div class="tags">
|
212
|
+
|
213
|
+
|
214
|
+
</div><div id="subclasses">
|
215
|
+
<h2>Direct Known Subclasses</h2>
|
216
|
+
<p class="children"><span class='object_link'><a href="HashMap.html" title="AutoC::HashMap (class)">HashMap</a></span>, <span class='object_link'><a href="HashSet.html" title="AutoC::HashSet (class)">HashSet</a></span>, <span class='object_link'><a href="List.html" title="AutoC::List (class)">List</a></span>, <span class='object_link'><a href="Queue.html" title="AutoC::Queue (class)">Queue</a></span>, <span class='object_link'><a href="Vector.html" title="AutoC::Vector (class)">Vector</a></span></p>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<h2>Constant Summary</h2>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
226
|
+
<ul class="summary">
|
227
|
+
|
228
|
+
<li class="public ">
|
229
|
+
<span class="summary_signature">
|
230
|
+
|
231
|
+
<a href="#element-instance_method" title="#element (instance method)">- (Object) <strong>element</strong> </a>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</span>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<span class="note title readonly">readonly</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<span class="summary_desc"><div class='inline'><div class="paragraph">
|
251
|
+
<p>Returns the value of attribute element.</p>
|
252
|
+
</div></div></span>
|
253
|
+
|
254
|
+
</li>
|
255
|
+
|
256
|
+
|
257
|
+
</ul>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></h3>
|
264
|
+
<p class="inherited"><span class='object_link'><a href="Type.html#type-instance_method" title="AutoC::Type#type (method)">#type</a></span></p>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
<h2>
|
269
|
+
Class Method Summary
|
270
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
271
|
+
</h2>
|
272
|
+
|
273
|
+
<ul class="summary">
|
274
|
+
|
275
|
+
<li class="public ">
|
276
|
+
<span class="summary_signature">
|
277
|
+
|
278
|
+
<a href="#coerce-class_method" title="coerce (class method)">+ (Object) <strong>coerce</strong>(type) </a>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
</span>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
293
|
+
|
294
|
+
</li>
|
295
|
+
|
296
|
+
|
297
|
+
</ul>
|
298
|
+
|
299
|
+
<h2>
|
300
|
+
Instance Method Summary
|
301
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
302
|
+
</h2>
|
303
|
+
|
304
|
+
<ul class="summary">
|
305
|
+
|
306
|
+
<li class="public ">
|
307
|
+
<span class="summary_signature">
|
308
|
+
|
309
|
+
<a href="#copy-instance_method" title="#copy (instance method)">- (Object) <strong>copy</strong>(*args) </a>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
</span>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
324
|
+
|
325
|
+
</li>
|
326
|
+
|
327
|
+
|
328
|
+
<li class="public ">
|
329
|
+
<span class="summary_signature">
|
330
|
+
|
331
|
+
<a href="#ctor-instance_method" title="#ctor (instance method)">- (Object) <strong>ctor</strong>(*args) </a>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</span>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
346
|
+
|
347
|
+
</li>
|
348
|
+
|
349
|
+
|
350
|
+
<li class="public ">
|
351
|
+
<span class="summary_signature">
|
352
|
+
|
353
|
+
<a href="#dtor-instance_method" title="#dtor (instance method)">- (Object) <strong>dtor</strong>(*args) </a>
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
</span>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
368
|
+
|
369
|
+
</li>
|
370
|
+
|
371
|
+
|
372
|
+
<li class="public ">
|
373
|
+
<span class="summary_signature">
|
374
|
+
|
375
|
+
<a href="#entities-instance_method" title="#entities (instance method)">- (Object) <strong>entities</strong> </a>
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</span>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
390
|
+
|
391
|
+
</li>
|
392
|
+
|
393
|
+
|
394
|
+
<li class="public ">
|
395
|
+
<span class="summary_signature">
|
396
|
+
|
397
|
+
<a href="#equal-instance_method" title="#equal (instance method)">- (Object) <strong>equal</strong>(*args) </a>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
</span>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
412
|
+
|
413
|
+
</li>
|
414
|
+
|
415
|
+
|
416
|
+
<li class="public ">
|
417
|
+
<span class="summary_signature">
|
418
|
+
|
419
|
+
<a href="#identify-instance_method" title="#identify (instance method)">- (Object) <strong>identify</strong>(*args) </a>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
</span>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
434
|
+
|
435
|
+
</li>
|
436
|
+
|
437
|
+
|
438
|
+
<li class="public ">
|
439
|
+
<span class="summary_signature">
|
440
|
+
|
441
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Collection) <strong>initialize</strong>(type_name, element_type, visibility = :public) </a>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
</span>
|
446
|
+
|
447
|
+
|
448
|
+
<span class="note title constructor">constructor</span>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
<span class="summary_desc"><div class='inline'><div class="paragraph">
|
458
|
+
<p>A new instance of Collection.</p>
|
459
|
+
</div></div></span>
|
460
|
+
|
461
|
+
</li>
|
462
|
+
|
463
|
+
|
464
|
+
<li class="public ">
|
465
|
+
<span class="summary_signature">
|
466
|
+
|
467
|
+
<a href="#less-instance_method" title="#less (instance method)">- (Object) <strong>less</strong>(*args) </a>
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
</span>
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
482
|
+
|
483
|
+
</li>
|
484
|
+
|
485
|
+
|
486
|
+
</ul>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Type.html" title="AutoC::Type (class)">Type</a></span></h3>
|
499
|
+
<p class="inherited"><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#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#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#static-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_exported_declarations-instance_method" title="AutoC::Type#write_exported_declarations (method)">#write_exported_declarations</a></span>, <span class='object_link'><a href="Type.html#write_exported_types-instance_method" title="AutoC::Type#write_exported_types (method)">#write_exported_types</a></span>, <span class='object_link'><a href="Type.html#write_implementations-instance_method" title="AutoC::Type#write_implementations (method)">#write_implementations</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>
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Code.html" title="AutoC::Code (class)">Code</a></span></h3>
|
510
|
+
<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#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>
|
511
|
+
<div id="constructor_details" class="method_details_list">
|
512
|
+
<h2>Constructor Details</h2>
|
513
|
+
|
514
|
+
<div class="method_details first">
|
515
|
+
<h3 class="signature first" id="initialize-instance_method">
|
516
|
+
|
517
|
+
- (<tt><span class='object_link'><a href="" title="AutoC::Collection (class)">Collection</a></span></tt>) <strong>initialize</strong>(type_name, element_type, visibility = :public)
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
</h3><div class="docstring">
|
524
|
+
<div class="discussion">
|
525
|
+
<div class="paragraph">
|
526
|
+
<p>Returns a new instance of Collection</p>
|
527
|
+
</div>
|
528
|
+
|
529
|
+
</div>
|
530
|
+
</div>
|
531
|
+
<div class="tags">
|
532
|
+
|
533
|
+
|
534
|
+
</div><table class="source_code">
|
535
|
+
<tr>
|
536
|
+
<td>
|
537
|
+
<pre class="lines">
|
538
|
+
|
539
|
+
|
540
|
+
75
|
541
|
+
76
|
542
|
+
77
|
543
|
+
78</pre>
|
544
|
+
</td>
|
545
|
+
<td>
|
546
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 75</span>
|
547
|
+
|
548
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_type_name'>type_name</span><span class='comma'>,</span> <span class='id identifier rubyid_element_type'>element_type</span><span class='comma'>,</span> <span class='id identifier rubyid_visibility'>visibility</span> <span class='op'>=</span> <span class='symbol'>:public</span><span class='rparen'>)</span>
|
549
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_type_name'>type_name</span><span class='comma'>,</span> <span class='id identifier rubyid_visibility'>visibility</span><span class='rparen'>)</span>
|
550
|
+
<span class='ivar'>@element</span> <span class='op'>=</span> <span class='const'>Collection</span><span class='period'>.</span><span class='id identifier rubyid_coerce'>coerce</span><span class='lparen'>(</span><span class='id identifier rubyid_element_type'>element_type</span><span class='rparen'>)</span>
|
551
|
+
<span class='kw'>end</span></pre>
|
552
|
+
</td>
|
553
|
+
</tr>
|
554
|
+
</table>
|
555
|
+
</div>
|
556
|
+
|
557
|
+
</div>
|
558
|
+
<div id="method_missing_details" class="method_details_list">
|
559
|
+
<h2>Dynamic Method Handling</h2>
|
560
|
+
<p class="notice super">
|
561
|
+
This class handles dynamic methods through the <tt>method_missing</tt> method
|
562
|
+
|
563
|
+
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>
|
564
|
+
|
565
|
+
</p>
|
566
|
+
|
567
|
+
</div>
|
568
|
+
|
569
|
+
<div id="instance_attr_details" class="attr_details">
|
570
|
+
<h2>Instance Attribute Details</h2>
|
571
|
+
|
572
|
+
|
573
|
+
<span id=""></span>
|
574
|
+
<div class="method_details first">
|
575
|
+
<h3 class="signature first" id="element-instance_method">
|
576
|
+
|
577
|
+
- (<tt>Object</tt>) <strong>element</strong> <span class="extras">(readonly)</span>
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
</h3><div class="docstring">
|
584
|
+
<div class="discussion">
|
585
|
+
<div class="paragraph">
|
586
|
+
<p>Returns the value of attribute element</p>
|
587
|
+
</div>
|
588
|
+
|
589
|
+
</div>
|
590
|
+
</div>
|
591
|
+
<div class="tags">
|
592
|
+
|
593
|
+
|
594
|
+
</div><table class="source_code">
|
595
|
+
<tr>
|
596
|
+
<td>
|
597
|
+
<pre class="lines">
|
598
|
+
|
599
|
+
|
600
|
+
71
|
601
|
+
72
|
602
|
+
73</pre>
|
603
|
+
</td>
|
604
|
+
<td>
|
605
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 71</span>
|
606
|
+
|
607
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_element'>element</span>
|
608
|
+
<span class='ivar'>@element</span>
|
609
|
+
<span class='kw'>end</span></pre>
|
610
|
+
</td>
|
611
|
+
</tr>
|
612
|
+
</table>
|
613
|
+
</div>
|
614
|
+
|
615
|
+
</div>
|
616
|
+
|
617
|
+
|
618
|
+
<div id="class_method_details" class="method_details_list">
|
619
|
+
<h2>Class Method Details</h2>
|
620
|
+
|
621
|
+
|
622
|
+
<div class="method_details first">
|
623
|
+
<h3 class="signature first" id="coerce-class_method">
|
624
|
+
|
625
|
+
+ (<tt>Object</tt>) <strong>coerce</strong>(type)
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
</h3><table class="source_code">
|
632
|
+
<tr>
|
633
|
+
<td>
|
634
|
+
<pre class="lines">
|
635
|
+
|
636
|
+
|
637
|
+
67
|
638
|
+
68
|
639
|
+
69</pre>
|
640
|
+
</td>
|
641
|
+
<td>
|
642
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 67</span>
|
643
|
+
|
644
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_coerce'>coerce</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
645
|
+
<span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Type</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>:</span> <span class='const'>UserDefinedType</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
646
|
+
<span class='kw'>end</span></pre>
|
647
|
+
</td>
|
648
|
+
</tr>
|
649
|
+
</table>
|
650
|
+
</div>
|
651
|
+
|
652
|
+
</div>
|
653
|
+
|
654
|
+
<div id="instance_method_details" class="method_details_list">
|
655
|
+
<h2>Instance Method Details</h2>
|
656
|
+
|
657
|
+
|
658
|
+
<div class="method_details first">
|
659
|
+
<h3 class="signature first" id="copy-instance_method">
|
660
|
+
|
661
|
+
- (<tt>Object</tt>) <strong>copy</strong>(*args)
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
</h3><table class="source_code">
|
668
|
+
<tr>
|
669
|
+
<td>
|
670
|
+
<pre class="lines">
|
671
|
+
|
672
|
+
|
673
|
+
100
|
674
|
+
101
|
675
|
+
102
|
676
|
+
103
|
677
|
+
104
|
678
|
+
105
|
679
|
+
106
|
680
|
+
107
|
681
|
+
108</pre>
|
682
|
+
</td>
|
683
|
+
<td>
|
684
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 100</span>
|
685
|
+
|
686
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_copy'>copy</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
687
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
688
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
689
|
+
<span class='kw'>else</span>
|
690
|
+
<span class='id identifier rubyid_check_args'>check_args</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span>
|
691
|
+
<span class='id identifier rubyid_dst'>dst</span><span class='comma'>,</span> <span class='id identifier rubyid_src'>src</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span>
|
692
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(&</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dst'>dst</span><span class='embexpr_end'>}</span><span class='tstring_content'>, &</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_src'>src</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
693
|
+
<span class='kw'>end</span>
|
694
|
+
<span class='kw'>end</span></pre>
|
695
|
+
</td>
|
696
|
+
</tr>
|
697
|
+
</table>
|
698
|
+
</div>
|
699
|
+
|
700
|
+
<div class="method_details ">
|
701
|
+
<h3 class="signature " id="ctor-instance_method">
|
702
|
+
|
703
|
+
- (<tt>Object</tt>) <strong>ctor</strong>(*args)
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
</h3><table class="source_code">
|
710
|
+
<tr>
|
711
|
+
<td>
|
712
|
+
<pre class="lines">
|
713
|
+
|
714
|
+
|
715
|
+
80
|
716
|
+
81
|
717
|
+
82
|
718
|
+
83
|
719
|
+
84
|
720
|
+
85
|
721
|
+
86
|
722
|
+
87
|
723
|
+
88</pre>
|
724
|
+
</td>
|
725
|
+
<td>
|
726
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 80</span>
|
727
|
+
|
728
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ctor'>ctor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
729
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
730
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
731
|
+
<span class='kw'>else</span>
|
732
|
+
<span class='id identifier rubyid_check_args'>check_args</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
|
733
|
+
<span class='id identifier rubyid_obj'>obj</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
734
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(&</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_obj'>obj</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
735
|
+
<span class='kw'>end</span>
|
736
|
+
<span class='kw'>end</span></pre>
|
737
|
+
</td>
|
738
|
+
</tr>
|
739
|
+
</table>
|
740
|
+
</div>
|
741
|
+
|
742
|
+
<div class="method_details ">
|
743
|
+
<h3 class="signature " id="dtor-instance_method">
|
744
|
+
|
745
|
+
- (<tt>Object</tt>) <strong>dtor</strong>(*args)
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
</h3><table class="source_code">
|
752
|
+
<tr>
|
753
|
+
<td>
|
754
|
+
<pre class="lines">
|
755
|
+
|
756
|
+
|
757
|
+
90
|
758
|
+
91
|
759
|
+
92
|
760
|
+
93
|
761
|
+
94
|
762
|
+
95
|
763
|
+
96
|
764
|
+
97
|
765
|
+
98</pre>
|
766
|
+
</td>
|
767
|
+
<td>
|
768
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 90</span>
|
769
|
+
|
770
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_dtor'>dtor</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
771
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
772
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
773
|
+
<span class='kw'>else</span>
|
774
|
+
<span class='id identifier rubyid_check_args'>check_args</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span>
|
775
|
+
<span class='id identifier rubyid_obj'>obj</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
776
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(&</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_obj'>obj</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
777
|
+
<span class='kw'>end</span>
|
778
|
+
<span class='kw'>end</span></pre>
|
779
|
+
</td>
|
780
|
+
</tr>
|
781
|
+
</table>
|
782
|
+
</div>
|
783
|
+
|
784
|
+
<div class="method_details ">
|
785
|
+
<h3 class="signature " id="entities-instance_method">
|
786
|
+
|
787
|
+
- (<tt>Object</tt>) <strong>entities</strong>
|
788
|
+
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
</h3><table class="source_code">
|
794
|
+
<tr>
|
795
|
+
<td>
|
796
|
+
<pre class="lines">
|
797
|
+
|
798
|
+
|
799
|
+
73</pre>
|
800
|
+
</td>
|
801
|
+
<td>
|
802
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 73</span>
|
803
|
+
|
804
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_entities'>entities</span><span class='semicolon'>;</span> <span class='kw'>super</span> <span class='op'>+</span> <span class='lbracket'>[</span><span class='id identifier rubyid_element'>element</span><span class='rbracket'>]</span> <span class='kw'>end</span></pre>
|
805
|
+
</td>
|
806
|
+
</tr>
|
807
|
+
</table>
|
808
|
+
</div>
|
809
|
+
|
810
|
+
<div class="method_details ">
|
811
|
+
<h3 class="signature " id="equal-instance_method">
|
812
|
+
|
813
|
+
- (<tt>Object</tt>) <strong>equal</strong>(*args)
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
|
819
|
+
</h3><table class="source_code">
|
820
|
+
<tr>
|
821
|
+
<td>
|
822
|
+
<pre class="lines">
|
823
|
+
|
824
|
+
|
825
|
+
110
|
826
|
+
111
|
827
|
+
112
|
828
|
+
113
|
829
|
+
114
|
830
|
+
115
|
831
|
+
116
|
832
|
+
117
|
833
|
+
118</pre>
|
834
|
+
</td>
|
835
|
+
<td>
|
836
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 110</span>
|
837
|
+
|
838
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
839
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
840
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
841
|
+
<span class='kw'>else</span>
|
842
|
+
<span class='id identifier rubyid_check_args'>check_args</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span>
|
843
|
+
<span class='id identifier rubyid_lt'>lt</span><span class='comma'>,</span> <span class='id identifier rubyid_rt'>rt</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span>
|
844
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>(&</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_lt'>lt</span><span class='embexpr_end'>}</span><span class='tstring_content'>, &</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_rt'>rt</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
845
|
+
<span class='kw'>end</span>
|
846
|
+
<span class='kw'>end</span></pre>
|
847
|
+
</td>
|
848
|
+
</tr>
|
849
|
+
</table>
|
850
|
+
</div>
|
851
|
+
|
852
|
+
<div class="method_details ">
|
853
|
+
<h3 class="signature " id="identify-instance_method">
|
854
|
+
|
855
|
+
- (<tt>Object</tt>) <strong>identify</strong>(*args)
|
856
|
+
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
|
861
|
+
</h3><table class="source_code">
|
862
|
+
<tr>
|
863
|
+
<td>
|
864
|
+
<pre class="lines">
|
865
|
+
|
866
|
+
|
867
|
+
124
|
868
|
+
125
|
869
|
+
126</pre>
|
870
|
+
</td>
|
871
|
+
<td>
|
872
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 124</span>
|
873
|
+
|
874
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_identify'>identify</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
875
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'> provides no hashing functionality</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
876
|
+
<span class='kw'>end</span></pre>
|
877
|
+
</td>
|
878
|
+
</tr>
|
879
|
+
</table>
|
880
|
+
</div>
|
881
|
+
|
882
|
+
<div class="method_details ">
|
883
|
+
<h3 class="signature " id="less-instance_method">
|
884
|
+
|
885
|
+
- (<tt>Object</tt>) <strong>less</strong>(*args)
|
886
|
+
|
887
|
+
|
888
|
+
|
889
|
+
|
890
|
+
|
891
|
+
</h3><table class="source_code">
|
892
|
+
<tr>
|
893
|
+
<td>
|
894
|
+
<pre class="lines">
|
895
|
+
|
896
|
+
|
897
|
+
120
|
898
|
+
121
|
899
|
+
122</pre>
|
900
|
+
</td>
|
901
|
+
<td>
|
902
|
+
<pre class="code"><span class="info file"># File 'lib/autoc/collection.rb', line 120</span>
|
903
|
+
|
904
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_less'>less</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
905
|
+
<span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'> provides no ordering functionality</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
906
|
+
<span class='kw'>end</span></pre>
|
907
|
+
</td>
|
908
|
+
</tr>
|
909
|
+
</table>
|
910
|
+
</div>
|
911
|
+
|
912
|
+
</div>
|
913
|
+
|
914
|
+
</div>
|
915
|
+
|
916
|
+
<div id="footer">
|
917
|
+
Generated on Fri Jun 6 18:05:35 2014 by
|
918
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
919
|
+
0.8.7.4 (ruby-2.0.0).
|
920
|
+
</div>
|
921
|
+
|
922
|
+
</body>
|
923
|
+
</html>
|