autoc 1.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +3 -0
  3. data/README.md +149 -0
  4. data/cmake/AutoC.cmake +39 -0
  5. data/lib/autoc/allocators.rb +51 -0
  6. data/lib/autoc/association.rb +126 -0
  7. data/lib/autoc/box.rb +311 -0
  8. data/lib/autoc/cmake.rb +54 -0
  9. data/lib/autoc/collection.rb +83 -110
  10. data/lib/autoc/composite.rb +333 -0
  11. data/lib/autoc/cstring.rb +263 -0
  12. data/lib/autoc/function.rb +247 -0
  13. data/lib/autoc/hash_map.rb +328 -0
  14. data/lib/autoc/hash_set.rb +339 -0
  15. data/lib/autoc/hashers.rb +102 -0
  16. data/lib/autoc/list.rb +444 -0
  17. data/lib/autoc/module.rb +434 -0
  18. data/lib/autoc/openmp.rb +15 -0
  19. data/lib/autoc/primitive.rb +27 -0
  20. data/lib/autoc/ranges.rb +707 -0
  21. data/lib/autoc/record.rb +247 -0
  22. data/lib/autoc/scaffold/docs.rb +117 -0
  23. data/lib/autoc/scaffold/generic_value.rb +86 -0
  24. data/lib/autoc/scaffold/project.rb +75 -0
  25. data/lib/autoc/scaffold/test_cstring.rb +113 -0
  26. data/lib/autoc/scaffold/test_cstring_hash_set.rb +35 -0
  27. data/lib/autoc/scaffold/test_int_box.rb +22 -0
  28. data/lib/autoc/scaffold/test_int_hash_set.rb +448 -0
  29. data/lib/autoc/scaffold/test_int_list.rb +106 -0
  30. data/lib/autoc/scaffold/test_int_vector.rb +83 -0
  31. data/lib/autoc/scaffold/test_v2v_hash_map.rb +83 -0
  32. data/lib/autoc/scaffold/test_value_hash_set.rb +60 -0
  33. data/lib/autoc/scaffold/test_value_vector.rb +146 -0
  34. data/{test/test.rb → lib/autoc/scaffold/tests.rb} +179 -158
  35. data/lib/autoc/scaffold.rb +12 -0
  36. data/lib/autoc/sequential.rb +99 -0
  37. data/lib/autoc/set.rb +331 -0
  38. data/lib/autoc/std.rb +149 -0
  39. data/lib/autoc/type.rb +93 -531
  40. data/lib/autoc/vector.rb +290 -0
  41. data/lib/autoc.rb +4 -35
  42. metadata +55 -85
  43. data/.yardopts +0 -4
  44. data/CHANGES +0 -23
  45. data/README +0 -28
  46. data/doc/AutoC/Code.html +0 -523
  47. data/doc/AutoC/Collection.html +0 -1214
  48. data/doc/AutoC/HashMap.html +0 -1441
  49. data/doc/AutoC/HashSet.html +0 -916
  50. data/doc/AutoC/Iterators/Bidirectional.html +0 -204
  51. data/doc/AutoC/Iterators/Unidirectional.html +0 -200
  52. data/doc/AutoC/Iterators.html +0 -126
  53. data/doc/AutoC/List.html +0 -1039
  54. data/doc/AutoC/Maps.html +0 -290
  55. data/doc/AutoC/Module/File.html +0 -415
  56. data/doc/AutoC/Module/Header.html +0 -437
  57. data/doc/AutoC/Module/Source.html +0 -707
  58. data/doc/AutoC/Module.html +0 -948
  59. data/doc/AutoC/Priority.html +0 -138
  60. data/doc/AutoC/Queue.html +0 -1172
  61. data/doc/AutoC/Reference.html +0 -735
  62. data/doc/AutoC/Sets.html +0 -520
  63. data/doc/AutoC/String.html +0 -1394
  64. data/doc/AutoC/TreeMap.html +0 -1565
  65. data/doc/AutoC/TreeSet.html +0 -1447
  66. data/doc/AutoC/Type.html +0 -2148
  67. data/doc/AutoC/UserDefinedType.html +0 -1047
  68. data/doc/AutoC/Vector.html +0 -987
  69. data/doc/AutoC.html +0 -331
  70. data/doc/_index.html +0 -388
  71. data/doc/class_list.html +0 -51
  72. data/doc/css/common.css +0 -1
  73. data/doc/css/full_list.css +0 -58
  74. data/doc/css/style.css +0 -481
  75. data/doc/file.CHANGES.html +0 -117
  76. data/doc/file.README.html +0 -116
  77. data/doc/file_list.html +0 -61
  78. data/doc/frames.html +0 -17
  79. data/doc/index.html +0 -116
  80. data/doc/js/app.js +0 -243
  81. data/doc/js/full_list.js +0 -216
  82. data/doc/js/jquery.js +0 -4
  83. data/doc/method_list.html +0 -1307
  84. data/doc/top-level-namespace.html +0 -112
  85. data/lib/autoc/code.rb +0 -237
  86. data/lib/autoc/collection/hash_map.rb +0 -385
  87. data/lib/autoc/collection/hash_set.rb +0 -337
  88. data/lib/autoc/collection/iterator.rb +0 -39
  89. data/lib/autoc/collection/list.rb +0 -429
  90. data/lib/autoc/collection/map.rb +0 -41
  91. data/lib/autoc/collection/queue.rb +0 -517
  92. data/lib/autoc/collection/set.rb +0 -134
  93. data/lib/autoc/collection/tree_map.rb +0 -464
  94. data/lib/autoc/collection/tree_set.rb +0 -611
  95. data/lib/autoc/collection/vector.rb +0 -336
  96. data/lib/autoc/string.rb +0 -492
  97. data/test/test_auto.c +0 -7141
  98. data/test/test_auto.h +0 -753
  99. data/test/test_char_string.rb +0 -270
  100. data/test/test_int_list.rb +0 -35
  101. data/test/test_int_tree_set.rb +0 -111
  102. data/test/test_int_vector.rb +0 -34
  103. data/test/test_value_hash_map.rb +0 -162
  104. data/test/test_value_hash_set.rb +0 -173
  105. data/test/test_value_list.rb +0 -193
  106. data/test/test_value_queue.rb +0 -275
  107. data/test/test_value_tree_map.rb +0 -176
  108. data/test/test_value_tree_set.rb +0 -173
  109. data/test/test_value_vector.rb +0 -155
  110. data/test/value.rb +0 -80
@@ -1,948 +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::Module
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::Module";
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 (M)</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">Module</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::Module
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName">Object</span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next">AutoC::Module</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/autoc/code.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
- <h2>Defined Under Namespace</h2>
105
- <p class="children">
106
-
107
-
108
-
109
-
110
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Module/File.html" title="AutoC::Module::File (class)">File</a></span>, <span class='object_link'><a href="Module/Header.html" title="AutoC::Module::Header (class)">Header</a></span>, <span class='object_link'><a href="Module/Source.html" title="AutoC::Module::Source (class)">Source</a></span>
111
-
112
-
113
- </p>
114
-
115
-
116
-
117
-
118
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
119
- <ul class="summary">
120
-
121
- <li class="public ">
122
- <span class="summary_signature">
123
-
124
- <a href="#header-instance_method" title="#header (instance method)">#<strong>header</strong> &#x21d2; Object </a>
125
-
126
-
127
-
128
- </span>
129
-
130
-
131
-
132
-
133
- <span class="note title readonly">readonly</span>
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
- <span class="summary_desc"><div class='inline'><div class="paragraph">
144
- <p>Returns the value of attribute header.</p>
145
- </div></div></span>
146
-
147
- </li>
148
-
149
-
150
- <li class="public ">
151
- <span class="summary_signature">
152
-
153
- <a href="#main_source-instance_method" title="#main_source (instance method)">#<strong>main_source</strong> &#x21d2; Object </a>
154
-
155
-
156
-
157
- </span>
158
-
159
-
160
-
161
-
162
- <span class="note title readonly">readonly</span>
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
- <span class="summary_desc"><div class='inline'><div class="paragraph">
173
- <p>Returns the value of attribute main_source.</p>
174
- </div></div></span>
175
-
176
- </li>
177
-
178
-
179
- <li class="public ">
180
- <span class="summary_signature">
181
-
182
- <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
183
-
184
-
185
-
186
- </span>
187
-
188
-
189
-
190
-
191
- <span class="note title readonly">readonly</span>
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
- <span class="summary_desc"><div class='inline'><div class="paragraph">
202
- <p>Returns the value of attribute name.</p>
203
- </div></div></span>
204
-
205
- </li>
206
-
207
-
208
- <li class="public ">
209
- <span class="summary_signature">
210
-
211
- <a href="#smallest_source-instance_method" title="#smallest_source (instance method)">#<strong>smallest_source</strong> &#x21d2; Object </a>
212
-
213
-
214
-
215
- </span>
216
-
217
-
218
-
219
-
220
- <span class="note title readonly">readonly</span>
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
- <span class="summary_desc"><div class='inline'><div class="paragraph">
231
- <p>Returns the value of attribute smallest_source.</p>
232
- </div></div></span>
233
-
234
- </li>
235
-
236
-
237
- </ul>
238
-
239
-
240
-
241
-
242
-
243
- <h2>
244
- Class Method Summary
245
- <small><a href="#" class="summary_toggle">collapse</a></small>
246
- </h2>
247
-
248
- <ul class="summary">
249
-
250
- <li class="public ">
251
- <span class="summary_signature">
252
-
253
- <a href="#generate%21-class_method" title="generate! (class method)">.<strong>generate!</strong>(name, &amp;block) &#x21d2; Object </a>
254
-
255
-
256
-
257
- </span>
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
- <span class="summary_desc"><div class='inline'></div></span>
268
-
269
- </li>
270
-
271
-
272
- </ul>
273
-
274
- <h2>
275
- Instance Method Summary
276
- <small><a href="#" class="summary_toggle">collapse</a></small>
277
- </h2>
278
-
279
- <ul class="summary">
280
-
281
- <li class="public ">
282
- <span class="summary_signature">
283
-
284
- <a href="#%3C%3C-instance_method" title="#&lt;&lt; (instance method)">#<strong>&lt;&lt;</strong>(obj) &#x21d2; Object </a>
285
-
286
-
287
-
288
- </span>
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
- <span class="summary_desc"><div class='inline'></div></span>
299
-
300
- </li>
301
-
302
-
303
- <li class="public ">
304
- <span class="summary_signature">
305
-
306
- <a href="#generate%21-instance_method" title="#generate! (instance method)">#<strong>generate!</strong> &#x21d2; Object </a>
307
-
308
-
309
-
310
- </span>
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
-
320
- <span class="summary_desc"><div class='inline'></div></span>
321
-
322
- </li>
323
-
324
-
325
- <li class="public ">
326
- <span class="summary_signature">
327
-
328
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name) &#x21d2; Module </a>
329
-
330
-
331
-
332
- </span>
333
-
334
-
335
- <span class="note title constructor">constructor</span>
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
- <span class="summary_desc"><div class='inline'><div class="paragraph">
345
- <p>A new instance of Module.</p>
346
- </div></div></span>
347
-
348
- </li>
349
-
350
-
351
- <li class="public ">
352
- <span class="summary_signature">
353
-
354
- <a href="#new_header-instance_method" title="#new_header (instance method)">#<strong>new_header</strong> &#x21d2; Object </a>
355
-
356
-
357
-
358
- </span>
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
-
368
- <span class="summary_desc"><div class='inline'></div></span>
369
-
370
- </li>
371
-
372
-
373
- <li class="public ">
374
- <span class="summary_signature">
375
-
376
- <a href="#new_source-instance_method" title="#new_source (instance method)">#<strong>new_source</strong>(index) &#x21d2; Object </a>
377
-
378
-
379
-
380
- </span>
381
-
382
-
383
-
384
-
385
-
386
-
387
-
388
-
389
-
390
- <span class="summary_desc"><div class='inline'></div></span>
391
-
392
- </li>
393
-
394
-
395
- <li class="public ">
396
- <span class="summary_signature">
397
-
398
- <a href="#source_count-instance_method" title="#source_count (instance method)">#<strong>source_count</strong> &#x21d2; Object </a>
399
-
400
-
401
-
402
- </span>
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
- <span class="summary_desc"><div class='inline'></div></span>
413
-
414
- </li>
415
-
416
-
417
- <li class="public ">
418
- <span class="summary_signature">
419
-
420
- <a href="#source_count%3D-instance_method" title="#source_count= (instance method)">#<strong>source_count=</strong>(count) &#x21d2; Object </a>
421
-
422
-
423
-
424
- </span>
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
- <span class="summary_desc"><div class='inline'></div></span>
435
-
436
- </li>
437
-
438
-
439
- </ul>
440
-
441
-
442
- <div id="constructor_details" class="method_details_list">
443
- <h2>Constructor Details</h2>
444
-
445
- <div class="method_details first">
446
- <h3 class="signature first" id="initialize-instance_method">
447
-
448
- #<strong>initialize</strong>(name) &#x21d2; <tt><span class='object_link'><a href="" title="AutoC::Module (class)">Module</a></span></tt>
449
-
450
-
451
-
452
-
453
-
454
- </h3><div class="docstring">
455
- <div class="discussion">
456
- <div class="paragraph">
457
- <p>Returns a new instance of Module</p>
458
- </div>
459
-
460
- </div>
461
- </div>
462
- <div class="tags">
463
-
464
-
465
- </div><table class="source_code">
466
- <tr>
467
- <td>
468
- <pre class="lines">
469
-
470
-
471
- 75
472
- 76
473
- 77
474
- 78
475
- 79</pre>
476
- </td>
477
- <td>
478
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 75</span>
479
-
480
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
481
- <span class='ivar'>@entities</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
482
- <span class='ivar'>@source_size_threshold</span> <span class='op'>=</span> <span class='int'>0</span>
483
- <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='comment'># TODO validate
484
- </span><span class='kw'>end</span></pre>
485
- </td>
486
- </tr>
487
- </table>
488
- </div>
489
-
490
- </div>
491
-
492
- <div id="instance_attr_details" class="attr_details">
493
- <h2>Instance Attribute Details</h2>
494
-
495
-
496
- <span id=""></span>
497
- <div class="method_details first">
498
- <h3 class="signature first" id="header-instance_method">
499
-
500
- #<strong>header</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
501
-
502
-
503
-
504
-
505
-
506
- </h3><div class="docstring">
507
- <div class="discussion">
508
- <div class="paragraph">
509
- <p>Returns the value of attribute header</p>
510
- </div>
511
-
512
- </div>
513
- </div>
514
- <div class="tags">
515
-
516
-
517
- </div><table class="source_code">
518
- <tr>
519
- <td>
520
- <pre class="lines">
521
-
522
-
523
- 73
524
- 74
525
- 75</pre>
526
- </td>
527
- <td>
528
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 73</span>
529
-
530
- <span class='kw'>def</span> <span class='id identifier rubyid_header'>header</span>
531
- <span class='ivar'>@header</span>
532
- <span class='kw'>end</span></pre>
533
- </td>
534
- </tr>
535
- </table>
536
- </div>
537
-
538
-
539
- <span id=""></span>
540
- <div class="method_details ">
541
- <h3 class="signature " id="main_source-instance_method">
542
-
543
- #<strong>main_source</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
544
-
545
-
546
-
547
-
548
-
549
- </h3><div class="docstring">
550
- <div class="discussion">
551
- <div class="paragraph">
552
- <p>Returns the value of attribute main_source</p>
553
- </div>
554
-
555
- </div>
556
- </div>
557
- <div class="tags">
558
-
559
-
560
- </div><table class="source_code">
561
- <tr>
562
- <td>
563
- <pre class="lines">
564
-
565
-
566
- 73
567
- 74
568
- 75</pre>
569
- </td>
570
- <td>
571
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 73</span>
572
-
573
- <span class='kw'>def</span> <span class='id identifier rubyid_main_source'>main_source</span>
574
- <span class='ivar'>@main_source</span>
575
- <span class='kw'>end</span></pre>
576
- </td>
577
- </tr>
578
- </table>
579
- </div>
580
-
581
-
582
- <span id=""></span>
583
- <div class="method_details ">
584
- <h3 class="signature " id="name-instance_method">
585
-
586
- #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
587
-
588
-
589
-
590
-
591
-
592
- </h3><div class="docstring">
593
- <div class="discussion">
594
- <div class="paragraph">
595
- <p>Returns the value of attribute name</p>
596
- </div>
597
-
598
- </div>
599
- </div>
600
- <div class="tags">
601
-
602
-
603
- </div><table class="source_code">
604
- <tr>
605
- <td>
606
- <pre class="lines">
607
-
608
-
609
- 73
610
- 74
611
- 75</pre>
612
- </td>
613
- <td>
614
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 73</span>
615
-
616
- <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
617
- <span class='ivar'>@name</span>
618
- <span class='kw'>end</span></pre>
619
- </td>
620
- </tr>
621
- </table>
622
- </div>
623
-
624
-
625
- <span id=""></span>
626
- <div class="method_details ">
627
- <h3 class="signature " id="smallest_source-instance_method">
628
-
629
- #<strong>smallest_source</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
630
-
631
-
632
-
633
-
634
-
635
- </h3><div class="docstring">
636
- <div class="discussion">
637
- <div class="paragraph">
638
- <p>Returns the value of attribute smallest_source</p>
639
- </div>
640
-
641
- </div>
642
- </div>
643
- <div class="tags">
644
-
645
-
646
- </div><table class="source_code">
647
- <tr>
648
- <td>
649
- <pre class="lines">
650
-
651
-
652
- 73
653
- 74
654
- 75</pre>
655
- </td>
656
- <td>
657
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 73</span>
658
-
659
- <span class='kw'>def</span> <span class='id identifier rubyid_smallest_source'>smallest_source</span>
660
- <span class='ivar'>@smallest_source</span>
661
- <span class='kw'>end</span></pre>
662
- </td>
663
- </tr>
664
- </table>
665
- </div>
666
-
667
- </div>
668
-
669
-
670
- <div id="class_method_details" class="method_details_list">
671
- <h2>Class Method Details</h2>
672
-
673
-
674
- <div class="method_details first">
675
- <h3 class="signature first" id="generate!-class_method">
676
-
677
- .<strong>generate!</strong>(name, &amp;block) &#x21d2; <tt>Object</tt>
678
-
679
-
680
-
681
-
682
-
683
- </h3><table class="source_code">
684
- <tr>
685
- <td>
686
- <pre class="lines">
687
-
688
-
689
- 67
690
- 68
691
- 69
692
- 70
693
- 71</pre>
694
- </td>
695
- <td>
696
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 67</span>
697
-
698
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_generate!'>generate!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
699
- <span class='id identifier rubyid_m'>m</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
700
- <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span>
701
- <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_generate!'>generate!</span>
702
- <span class='kw'>end</span></pre>
703
- </td>
704
- </tr>
705
- </table>
706
- </div>
707
-
708
- </div>
709
-
710
- <div id="instance_method_details" class="method_details_list">
711
- <h2>Instance Method Details</h2>
712
-
713
-
714
- <div class="method_details first">
715
- <h3 class="signature first" id="<<-instance_method">
716
-
717
- #<strong>&lt;&lt;</strong>(obj) &#x21d2; <tt>Object</tt>
718
-
719
-
720
-
721
-
722
-
723
- </h3><table class="source_code">
724
- <tr>
725
- <td>
726
- <pre class="lines">
727
-
728
-
729
- 81
730
- 82
731
- 83
732
- 84</pre>
733
- </td>
734
- <td>
735
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 81</span>
736
-
737
- <span class='kw'>def</span> <span class='op'>&lt;&lt;</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
738
- <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='kw'>self</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_e'>e</span><span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='ivar'>@entities</span><span class='period'>.</span><span class='id identifier rubyid_add?'>add?</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
739
- <span class='kw'>self</span>
740
- <span class='kw'>end</span></pre>
741
- </td>
742
- </tr>
743
- </table>
744
- </div>
745
-
746
- <div class="method_details ">
747
- <h3 class="signature " id="generate!-instance_method">
748
-
749
- #<strong>generate!</strong> &#x21d2; <tt>Object</tt>
750
-
751
-
752
-
753
-
754
-
755
- </h3><table class="source_code">
756
- <tr>
757
- <td>
758
- <pre class="lines">
759
-
760
-
761
- 98
762
- 99
763
- 100
764
- 101
765
- 102
766
- 103
767
- 104
768
- 105
769
- 106
770
- 107
771
- 108
772
- 109
773
- 110
774
- 111
775
- 112
776
- 113</pre>
777
- </td>
778
- <td>
779
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 98</span>
780
-
781
- <span class='kw'>def</span> <span class='id identifier rubyid_generate!'>generate!</span>
782
- <span class='ivar'>@header</span> <span class='op'>=</span> <span class='id identifier rubyid_new_header'>new_header</span>
783
- <span class='ivar'>@sources</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
784
- <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='id identifier rubyid_source_count'>source_count</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='ivar'>@sources</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_new_source'>new_source</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span><span class='rbrace'>}</span>
785
- <span class='ivar'>@main_source</span> <span class='op'>=</span> <span class='ivar'>@sources</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
786
- <span class='ivar'>@smallest_source</span> <span class='op'>=</span> <span class='ivar'>@main_source</span>
787
- <span class='comment'># It appears that computing the size of a source might be a fairly expensive operation so do it only when necessary
788
- </span> <span class='id identifier rubyid_refresh_smallest_source'>refresh_smallest_source</span> <span class='op'>=</span> <span class='id identifier rubyid_source_count'>source_count</span> <span class='op'>&gt;</span> <span class='int'>1</span>
789
- <span class='ivar'>@entities</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
790
- <span class='ivar'>@header</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_e'>e</span>
791
- <span class='ivar'>@smallest_source</span> <span class='op'>=</span> <span class='ivar'>@sources</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_refresh_smallest_source'>refresh_smallest_source</span>
792
- <span class='ivar'>@sources</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_attach'>attach</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='rparen'>)</span><span class='rbrace'>}</span>
793
- <span class='kw'>end</span>
794
- <span class='ivar'>@header</span><span class='period'>.</span><span class='id identifier rubyid_generate'>generate</span>
795
- <span class='ivar'>@sources</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_generate'>generate</span><span class='rbrace'>}</span>
796
- <span class='kw'>end</span></pre>
797
- </td>
798
- </tr>
799
- </table>
800
- </div>
801
-
802
- <div class="method_details ">
803
- <h3 class="signature " id="new_header-instance_method">
804
-
805
- #<strong>new_header</strong> &#x21d2; <tt>Object</tt>
806
-
807
-
808
-
809
-
810
-
811
- </h3><table class="source_code">
812
- <tr>
813
- <td>
814
- <pre class="lines">
815
-
816
-
817
- 86
818
- 87
819
- 88</pre>
820
- </td>
821
- <td>
822
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 86</span>
823
-
824
- <span class='kw'>def</span> <span class='id identifier rubyid_new_header'>new_header</span>
825
- <span class='const'>Header</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
826
- <span class='kw'>end</span></pre>
827
- </td>
828
- </tr>
829
- </table>
830
- </div>
831
-
832
- <div class="method_details ">
833
- <h3 class="signature " id="new_source-instance_method">
834
-
835
- #<strong>new_source</strong>(index) &#x21d2; <tt>Object</tt>
836
-
837
-
838
-
839
-
840
-
841
- </h3><table class="source_code">
842
- <tr>
843
- <td>
844
- <pre class="lines">
845
-
846
-
847
- 90
848
- 91
849
- 92</pre>
850
- </td>
851
- <td>
852
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 90</span>
853
-
854
- <span class='kw'>def</span> <span class='id identifier rubyid_new_source'>new_source</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
855
- <span class='const'>Source</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
856
- <span class='kw'>end</span></pre>
857
- </td>
858
- </tr>
859
- </table>
860
- </div>
861
-
862
- <div class="method_details ">
863
- <h3 class="signature " id="source_count-instance_method">
864
-
865
- #<strong>source_count</strong> &#x21d2; <tt>Object</tt>
866
-
867
-
868
-
869
-
870
-
871
- </h3><table class="source_code">
872
- <tr>
873
- <td>
874
- <pre class="lines">
875
-
876
-
877
- 115
878
- 116
879
- 117
880
- 118
881
- 119
882
- 120
883
- 121
884
- 122
885
- 123
886
- 124</pre>
887
- </td>
888
- <td>
889
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 115</span>
890
-
891
- <span class='kw'>def</span> <span class='id identifier rubyid_source_count'>source_count</span>
892
- <span class='kw'>if</span> <span class='ivar'>@source_count</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
893
- <span class='id identifier rubyid_total'>total</span> <span class='op'>=</span> <span class='int'>0</span>
894
- <span class='ivar'>@entities</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_total'>total</span> <span class='op'>+=</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_source_size'>source_size</span><span class='rbrace'>}</span>
895
- <span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='ivar'>@source_size_threshold</span> <span class='op'>&gt;</span> <span class='int'>0</span> <span class='op'>?</span> <span class='lparen'>(</span><span class='id identifier rubyid_total'>total</span><span class='op'>/</span><span class='ivar'>@source_size_threshold</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='int'>1</span>
896
- <span class='ivar'>@source_count</span> <span class='op'>=</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>&gt;</span> <span class='int'>0</span> <span class='op'>?</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>:</span> <span class='int'>1</span>
897
- <span class='kw'>else</span>
898
- <span class='ivar'>@source_count</span>
899
- <span class='kw'>end</span>
900
- <span class='kw'>end</span></pre>
901
- </td>
902
- </tr>
903
- </table>
904
- </div>
905
-
906
- <div class="method_details ">
907
- <h3 class="signature " id="source_count=-instance_method">
908
-
909
- #<strong>source_count=</strong>(count) &#x21d2; <tt>Object</tt>
910
-
911
-
912
-
913
-
914
-
915
- </h3><table class="source_code">
916
- <tr>
917
- <td>
918
- <pre class="lines">
919
-
920
-
921
- 94
922
- 95
923
- 96</pre>
924
- </td>
925
- <td>
926
- <pre class="code"><span class="info file"># File 'lib/autoc/code.rb', line 94</span>
927
-
928
- <span class='kw'>def</span> <span class='id identifier rubyid_source_count='>source_count=</span><span class='lparen'>(</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
929
- <span class='ivar'>@source_count</span> <span class='op'>=</span> <span class='id identifier rubyid_count'>count</span>
930
- <span class='kw'>end</span></pre>
931
- </td>
932
- </tr>
933
- </table>
934
- </div>
935
-
936
- </div>
937
-
938
- </div>
939
-
940
- <div id="footer">
941
- Generated on Wed Oct 12 12:27:11 2016 by
942
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
943
- 0.9.5 (ruby-2.3.1).
944
- </div>
945
-
946
- </div>
947
- </body>
948
- </html>